Laravel 5.8 谷歌认证后在自定义表中存储数据
默认情况下,此数据存储在“用户”表中,但我需要将数据存储在“新用户”表中。我需要更新哪些内容和位置Laravel 5.8 谷歌认证后在自定义表中存储数据,laravel-5.8,Laravel 5.8,默认情况下,此数据存储在“用户”表中,但我需要将数据存储在“新用户”表中。我需要更新哪些内容和位置 SocialGoogleAccount extends Model { protected $fillable = ['user_id', 'provider_user_id', 'provider']; public function newuser() { return $this->belongsTo(User::class); }
SocialGoogleAccount extends Model
{
protected $fillable = ['user_id', 'provider_user_id', 'provider'];
public function newuser()
{
return $this->belongsTo(User::class);
}
}
my controller is
public function redirect()
{
return Socialite::driver('google')->redirect();
}
/**
* Return a callback method from google api.
*
* @return callback URL from google
*/
public function callback(SocialGoogleAccountService $service)
{
$user = $service->createOrGetUser(Socialite::driver('google')->user());
auth()->login($user);
return redirect()->to('/');
}