PHP Class App\Http\Controllers\OauthController

Inheritance: extends Laravel\Lumen\Routing\Controller
Datei anzeigen Open project: unicodeveloper/laravel-hackathon-starter

Protected Properties

Property Type Description
$auth
$socialite

Public Methods

Method Description
__construct ( Laravel\Socialite\Contracts\Factory $socialite, Illuminate\Contracts\Auth\Guard $auth )
authenticate ( Illuminate\Http\Request $request, $provider )
checkIfUserNeedsUpdating ( $userData, $user ) Check if the user's info needs updating
execute ( $request, $provider )
findByProviderIdOrCreate ( $userData, $provider ) : User Find a user by username or create a new user

Private Methods

Method Description
getAuthorizationFirst ( $provider ) : RedirectResponse Redirect the user to the Social Media Account authentication page
getSocialUser ( string $provider ) : collection Get Data from Social Media Account
isEmailExists ( $email = null )
isUsernameExists ( $username = null )

Method Details

__construct() public method

public __construct ( Laravel\Socialite\Contracts\Factory $socialite, Illuminate\Contracts\Auth\Guard $auth )
$socialite Laravel\Socialite\Contracts\Factory
$auth Illuminate\Contracts\Auth\Guard

authenticate() public method

public authenticate ( Illuminate\Http\Request $request, $provider )
$request Illuminate\Http\Request

checkIfUserNeedsUpdating() public method

Check if the user's info needs updating
public checkIfUserNeedsUpdating ( $userData, $user )
$userData
$user

execute() public method

public execute ( $request, $provider )

findByProviderIdOrCreate() public method

Find a user by username or create a new user
public findByProviderIdOrCreate ( $userData, $provider ) : User
$userData
$provider
return app\User

Property Details

$auth protected_oe property

protected $auth

$socialite protected_oe property

protected $socialite