public function getAuthenticatedUser()
    {
        try {
            if (! $user = JWTAuth::parseToken()->authenticate()) {
                return response()->json(['user_not_found'], 404);
            }
        } catch (\Tymon\JWTAuth\Exceptions\TokenExpiredException $e) {
            return response()->json(['token_expired'], $e->getStatusCode());
        } catch (\Tymon\JWTAuth\Exceptions\TokenInvalidException $e) {
            return response()->json(['token_invalid'], $e->getStatusCode());
        } catch (\Tymon\JWTAuth\Exceptions\JWTException $e) {
            return response()->json(['token_absent'], $e->getStatusCode());
        }

        return $user;
    }
public function getAuthenticatedUser()
    {
        try {
            if (! $user = JWTAuth::parseToken()->authenticate()) {
                return response()->json(['user_not_found'], 404);
            }
        } catch (\Tymon\JWTAuth\Exceptions\TokenExpiredException $e) {
            return response()->json(['token_expired'], $e->getStatusCode());
        } catch (\Tymon\JWTAuth\Exceptions\TokenInvalidException $e) {
            return response()->json(['token_invalid'], $e->getStatusCode());
        } catch (\Tymon\JWTAuth\Exceptions\JWTException $e) {
            return response()->json(['token_absent'], $e->getStatusCode());
        }

        return $user;
    }
public function getAuthenticatedUser ( ) { try { if ( ! $ user = JWTAuth :: parseToken ( ) -> authenticate ( ) ) { return response ( ) -> json ( [ 'user_not_found' ] , 404 ) ; } } catch ( \ Tymon \ JWTAuth \ Exceptions \ TokenExpiredException $ e ) { return response ( ) -> json ( [ 'token_expired' ] , $ e -> getStatusCode ( ) ) ; } catch ( \ Tymon \ JWTAuth \ Exceptions \ TokenInvalidException $ e ) { return response ( ) -> json ( [ 'token_invalid' ] , $ e -> getStatusCode ( ) ) ; } catch ( \ Tymon \ JWTAuth \ Exceptions \ JWTException $ e ) { return response ( ) -> json ( [ 'token_absent' ] , $ e -> getStatusCode ( ) ) ; } return $ user ; }
Get the user

@return \Illuminate\Http\Response
Get the user