Laravel 8 获取用户实例
有了用户实例之后,你就可以获取更多用户详情:
$user = Socialite::driver('github')->user();
// OAuth2 Providers
$token = $user->token;
$refreshToken = $user->refreshToken; // 有时会被提供
$expiresIn = $user->expiresIn;
// OAuth1 Providers
$token = $user->token;
$tokenSecret = $user->tokenSecret;
// 所有 Providers
$user->getId();
$user->getNickname();
$user->getName();
$user->getEmail();
$user->getAvatar();