src/Core/Exceptions/Handler.php
protected function unauthenticated($request, AuthenticationException $e)
    {
        return $request->expectsJson()
            ? response()->json(['message' => $e->getMessage()], 401)
            : redirect()->guest($e->redirectTo() ?? route('login'));
    }
protected function unauthenticated($request, AuthenticationException $e)
    {
        return $request->expectsJson()
            ? response()->json(['message' => $e->getMessage()], 401)
            : redirect()->guest($e->redirectTo() ?? route('login'));
    }
protected function unauthenticated ( $ request , AuthenticationException $ e ) { return $ request -> expectsJson ( ) ? response ( ) -> json ( [ 'message' => $ e -> getMessage ( ) ] , 401 ) : redirect ( ) -> guest ( $ e -> redirectTo ( ) ?? route ( 'login' ) ) ; }
Convert an authentication exception into a response.

@param Request                 $request
@param AuthenticationException $e

@return Response
Convert an authentication exception into a response .