only('email', 'password')); abort_unless($token, 401, 'Invalid credentials'); return response()->json(compact('token')); } /** * Log the current user out. * * @return JsonResponse */ public function logout() { if ($token = JWTAuth::getToken()) { try { JWTAuth::invalidate($token); } catch (Exception $e) { Log::error($e); } } return response()->json(); } }