PHP code example of kanazaca / laravel-steam-auth
1. Go to this page and download the library: Download kanazaca/laravel-steam-auth library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kanazaca / laravel-steam-auth example snippets
'providers' => array(
// ...
'kanazaca\LaravelSteamAuth\SteamServiceProvider',
)
use kanazaca\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->steamInfo; //returns the user steam info
}else{
return $this->steam->redirect(); //redirect to steam login page
}
}
}
php artisan vendor:publish