You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Issue appear on this line:
'name' => head($account->email)->value,
public function store(Request $request, Google $google)
{
if (! $request->has('code')) {
return redirect($google->createAuthUrl());
}
// Use the given code to authenticate the user.
$google->authenticate($request->get('code'));
// Make a call to the Google+ API to get more information on the account.
$account = $google->service('Oauth2')->userinfo->get();
auth()->user()->googleAccounts()->updateOrCreate(
[
// Map the account's id to the `google_id`.
'google_id' => $account->id,
],
[
// Use the first email address as the Google account's name.
'name' => head($account->email)->value,
// Last but not least, save the access token for later use.
'token' => $google->getAccessToken(),
]
);
return redirect()->route('google.index');
}
The text was updated successfully, but these errors were encountered:
Issue appear on this line:
'name' => head($account->email)->value,
public function store(Request $request, Google $google)
{
if (! $request->has('code')) {
return redirect($google->createAuthUrl());
}
The text was updated successfully, but these errors were encountered: