谷歌认证后将数据存储在定制表中

时间:2019-09-26 13:51:28

标签: laravel-5.8

默认情况下,此数据存储在“用户”表中,但我需要在“ 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('/');
    }

0 个答案:

没有答案