默认情况下,此数据存储在“用户”表中,但我需要在“ new_users”表中存储数据,我需要在什么地方和何处更新???
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('/');
}