public function confirmAccount($token)
    {
        $user = User::where('confirmation_token', $token)->first();
        if ($user) {
            if ($user->confirmed_at && strlen($user->confirmed_at) > 6) {
                alert()->info('Account is Active',
                    'Your account is already active, please try to sign in.');
            }
            else {
                // confirm / activate user
                $user->confirmation_token = null;
                $user->confirmed_at = Carbon::now();
                $user->update();

                // notify
                $user->notify(new UserConfirmedAccount());

                alert()->success('Success',
                    '<br/>Congratulations, your account has been activated. Please Sign In below.');

                log_activity('User Confirmed', $user->fullname . ' confirmed their account', $user);
            }
        }
        else {
            alert()->error('Whoops!', 'Sorry, the token does not exist.');

            log_activity('User Confirmed', 'INVALID TOKEN');
        }

        return redirect(route('login'));
    }
public function confirmAccount($token)
    {
        $user = User::where('confirmation_token', $token)->first();
        if ($user) {
            if ($user->confirmed_at && strlen($user->confirmed_at) > 6) {
                alert()->info('Account is Active',
                    'Your account is already active, please try to sign in.');
            }
            else {
                // confirm / activate user
                $user->confirmation_token = null;
                $user->confirmed_at = Carbon::now();
                $user->update();

                // notify
                $user->notify(new UserConfirmedAccount());

                alert()->success('Success',
                    '<br/>Congratulations, your account has been activated. Please Sign In below.');

                log_activity('User Confirmed', $user->fullname . ' confirmed their account', $user);
            }
        }
        else {
            alert()->error('Whoops!', 'Sorry, the token does not exist.');

            log_activity('User Confirmed', 'INVALID TOKEN');
        }

        return redirect(route('login'));
    }
public function confirmAccount ( $ token ) { $ user = User :: where ( 'confirmation_token' , $ token ) -> first ( ) ; if ( $ user ) { if ( $ user -> confirmed_at && strlen ( $ user -> confirmed_at ) > 6 ) { alert ( ) -> info ( 'Account is Active' , 'Your account is already active, please try to sign in.' ) ; } else { // confirm / activate user $ user -> confirmation_token = null ; $ user -> confirmed_at = Carbon :: now ( ) ; $ user -> update ( ) ; // notify $ user -> notify ( new UserConfirmedAccount ( ) ) ; alert ( ) -> success ( 'Success' , '<br/>Congratulations, your account has been activated. Please Sign In below.' ) ; log_activity ( 'User Confirmed' , $ user -> fullname . ' confirmed their account' , $ user ) ; } } else { alert ( ) -> error ( 'Whoops!' , 'Sorry, the token does not exist.' ) ; log_activity ( 'User Confirmed' , 'INVALID TOKEN' ) ; } return redirect ( route ( 'login' ) ) ; }
User click on register confirmation link in mail

@param $token
@return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
User click on register confirmation link in mail