Skip to content

scotty0100/laravel-steam-auth

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Steam authentication for laravel 5

Latest Stable Version Total Downloads License

This package is a Laravel 5 service provider which provides Steam OpenID and is very easy to integrate with any project which requires steam authentication.

Installation Via Composer

Add this to your composer.json file, in the require object:

"invisnik/laravel-steam-auth": "1.1.*"

After that, run composer install to install the package.

Add the service provider to app/config/app.php, within the providers array.

'providers' => array(
	// ...
	'Invisnik\LaravelSteamAuth\SteamServiceProvider',
)
'aliases' => array(
	// ...
	'SteamAuth' => 'Invisnik\LaravelSteamAuth\Facades\SteamAuth',
)

You how have access to the SteamAuth facade.

Lastly, publish the config file.

php artisan vendor:publish

Usage

use Invisnik\LaravelSteamAuth\SteamAuth;

class SteamController extends Controller {

    /**
     * @var SteamAuth
     */
    private $steam;

    public function __construct(SteamAuth $steam)
    {
        $this->steam = $steam;
    }

	public function getLogin()
	{

        if( $this->steam->validate()){
            return  $this->steam->getSteamId();  //returns the user steamid
        }else{
            return  $this->steam->redirect(); //redirect to steam login page
        }
	}
}

About

Laravel Steam Auth

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%