app/Http/Controllers/AuthenticationController.php
/*
     * Callback Sign Up With GoogleAccount
     * @return Response
     */
Callback Sign Up With GoogleAccount
@return Response
Callback Sign Up With GoogleAccount @return Response
public function handleGoogleCallback()
    {
        $user = Socialite::driver('google')->user();
        $data['name'] = $user->name;
        $data['email'] = $user->email;
        $isRegistered = User::where("email", $data['email'])->first();
        if ($isRegistered) {
            if (!$isRegistered->is_active) {
                return redirect()->route('authentication.index')->with('deactivated', 'Your account is deactivated');
            }
            Auth::login($isRegistered);
            return redirect()->route('panel.dashboard');
        }
        $data['password'] = "12345678";
        $data['is_active'] = '0';
        $data['ts_register'] = Carbon::now()->timestamp;
        User::create($data);
        return redirect()->route('authentication.index')->with('signup', 'Your account has been created. Please wait for confirmation');
    }
public function handleGoogleCallback ( ) { $ user = Socialite :: driver ( 'google' ) -> user ( ) ; $ data [ 'name' ] = $ user -> name ; $ data [ 'email' ] = $ user -> email ; $ isRegistered = User :: where ( " email " , $ data [ 'email' ] ) -> first ( ) ; if ( $ isRegistered ) { if ( ! $ isRegistered -> is_active ) { return redirect ( ) -> route ( 'authentication.index' ) -> with ( 'deactivated' , 'Your account is deactivated' ) ; } Auth :: login ( $ isRegistered ) ; return redirect ( ) -> route ( 'panel.dashboard' ) ; } $ data [ 'password' ] = " 12345678 " ; $ data [ 'is_active' ] = '0' ; $ data [ 'ts_register' ] = Carbon :: now ( ) -> timestamp ; User :: create ( $ data ) ; return redirect ( ) -> route ( 'authentication.index' ) -> with ( 'signup' , 'Your account has been created. Please wait for confirmation' ) ; }
Callback Sign Up With GoogleAccount
 @return Response
Callback Sign Up With GoogleAccount @return Response