laravel 7 socialite code example
Example 1: socialite laravel 7
return Socialite::driver('github')
->setScopes(['read:user', 'public_repo'])
->redirect();
Example 2: socialite laravel 7
return Socialite::driver('google')->stateless()->user();
Example 3: laravel socialite
composer require laravel/socialite
Example 4: socialite laravel 7
return Socialite::driver('google')
->with(['hd' => 'example.com'])
->redirect();
Example 5: socialite laravel 7
$user = Socialite::driver('github')->user();
$token = $user->token;
$refreshToken = $user->refreshToken;
$expiresIn = $user->expiresIn;
$token = $user->token;
$tokenSecret = $user->tokenSecret;
$user->getId();
$user->getNickname();
$user->getName();
$user->getEmail();
$user->getAvatar();