kanalumaddela / laravel-steam-login by kanalumaddela

Steam Login/Auth package for Laravel/Lumen 5.5+ / 6.x+ / 7.x+ / 8.x+
8,789
9
2
Package Data
Maintainer Username: kanalumaddela
Maintainer Contact: git@maddela.org (Sam)
Package Create Date: 2018-01-29
Package Last Update: 2023-04-19
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-04-18 15:15:43
Package Statistics
Total Downloads: 8,789
Monthly Downloads: 134
Daily Downloads: 1
Total Stars: 9
Total Watchers: 2
Total Forks: 10
Total Open Issues: 6

Steam Auth/Login for Laravel 5.5+

Maintainability Packagist Packagist version PHP from Packagist GitHub stars GitHub forks GitHub issues GitHub license

Make sure you have made/performed your migrations along with updating your User model if you plan to follow the examples. I suggest doing whatever works best for you, but certain suggestions should be followed.

| Version | PHP Version | Laravel Version | Docs | | ------- | ----------- | --------------- | ---- | | 1.x | 7.0+ | 5.5+ | Docs | | 2.x | 7.1+ | 5.6+ | Docs |

Features

  • redirect users to the page they were on before logging in
  • SteamUserclass to easily retrieve a player's data
  • included controller and routes for easy setup

Quick Setup (2.x, Laravel 5.6+)

  1. Install library
composer require kanalumaddela/laravel-steam-login

php artisan vendor:publish --force --provider kanalumaddela\LaravelSteamLogin\SteamLoginServiceProvider
  1. Add routes

routes/web.php

use App\Http\Controllers\Auth\SteamLoginController;
use kanalumaddela\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 kanalumaddela\LaravelSteamLogin\Http\Controllers\AbstractSteamLoginController;
use kanalumaddela\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/Ehesp/Steam-Login (Parts of code used and re-purposed for laravel)
  • https://github.com/invisnik/laravel-steam-auth (Getting me to create a laravel steam auth/login that isn't bad)