skyraptor / laravel-steam-login
Steam Login package for Laravel 5.5+
2.7.1
2021-03-12 16:12 UTC
Requires
- php: ^7.3|^8.0
- ext-json: *
- ext-libxml: *
- ext-simplexml: *
- guzzlehttp/guzzle: ^6.5.5|^7.0.1
- xpaw/steamid: ^2.0.0
Requires (Dev)
- orchestra/testbench: ^3.8
- phpunit/phpunit: ^8.1
This package is auto-updated.
Last update: 2024-04-22 00:54:59 UTC
README
A light package to provide easy authentication with the Steam API to your Laravel project.
Features
- Redirect users to the page they were on before logging in
SteamUser
class to easily retrieve a player's data- Included controller and routes for easy setup
Installation
- Install library
composer require skyraptor/laravel-steam-login
php artisan vendor:publish --force --provider skyraptor\LaravelSteamLogin\SteamLoginServiceProvider
- Add routes
routes/web.php
use App\Http\Controllers\Auth\SteamLoginController; use skyraptor\LaravelSteamLogin\Facades\SteamLogin; //... SteamLogin::routes(['controller' => SteamLoginController::class]);
php artisan make:controller Auth\SteamLoginController
App\Http\Controllers\Auth\SteamLoginController.php
<?php namespace App\Http\Controllers\Auth; use Illuminate\Http\Request; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Hash; use skyraptor\LaravelSteamLogin\Http\Controllers\AbstractSteamLoginController; use skyraptor\LaravelSteamLogin\SteamUser; class SteamLoginController extends AbstractSteamLoginController { /** * {@inheritdoc} */ public function authenticated(Request $request, SteamUser $steamUser) { // auth logic goes here // e.g. $user = User::where('steam_account_id', $steamUser->accountId)->first(); } }
Credits
Thanks to these libs which led me to make this
- https://github.com/kanalumaddela/laravel-steam-login (original author)
- https://github.com/Ehesp/Steam-Login (Parts of code used and re-purposed for laravel)
- https://github.com/invisnik/laravel-steam-auth