public function activate($tokenString)
    {
        $token = $this->findToken($tokenString);

        // If we could not find a token or it has expired, fail the attempt.
        if (is_null($token) || $token->isExpired()) {
            return Response::failed('Activation failed.')
                           ->route('auth.invitation.failed', $tokenString);
        }

        // Activate the user and log them in.
        $token->user->activateInvitation();

        auth()->login($token->user);

        return Response::passed('Your account has been activated.')
                       ->route('home');
    }
public function activate($tokenString)
    {
        $token = $this->findToken($tokenString);

        // If we could not find a token or it has expired, fail the attempt.
        if (is_null($token) || $token->isExpired()) {
            return Response::failed('Activation failed.')
                           ->route('auth.invitation.failed', $tokenString);
        }

        // Activate the user and log them in.
        $token->user->activateInvitation();

        auth()->login($token->user);

        return Response::passed('Your account has been activated.')
                       ->route('home');
    }
public function activate ( $ tokenString ) { $ token = $ this -> findToken ( $ tokenString ) ; // If we could not find a token or it has expired, fail the attempt. if ( is_null ( $ token ) || $ token -> isExpired ( ) ) { return Response :: failed ( 'Activation failed.' ) -> route ( 'auth.invitation.failed' , $ tokenString ) ; } // Activate the user and log them in. $ token -> user -> activateInvitation ( ) ; auth ( ) -> login ( $ token -> user ) ; return Response :: passed ( 'Your account has been activated.' ) -> route ( 'home' ) ; }
Attempt to activate the user by the provided token.

@param string $tokenString The invitation token.

@return Response
Attempt to activate the user by the provided token .