From 758392c30fa0b2651ca9409aebb040a64816dde4 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Sat, 6 May 2017 16:11:24 -0400 Subject: [PATCH] clean up exception handler --- app/Exceptions/Handler.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index a747e31b817..653cadf1674 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -14,12 +14,7 @@ class Handler extends ExceptionHandler * @var array */ protected $dontReport = [ - \Illuminate\Auth\AuthenticationException::class, - \Illuminate\Auth\Access\AuthorizationException::class, - \Symfony\Component\HttpKernel\Exception\HttpException::class, - \Illuminate\Database\Eloquent\ModelNotFoundException::class, - \Illuminate\Session\TokenMismatchException::class, - \Illuminate\Validation\ValidationException::class, + // ]; /** @@ -56,10 +51,8 @@ public function render($request, Exception $exception) */ protected function unauthenticated($request, AuthenticationException $exception) { - if ($request->expectsJson()) { - return response()->json(['error' => 'Unauthenticated.'], 401); - } - - return redirect()->guest(route('login')); + return $request->expectsJson() + ? response()->json(['error' => 'Unauthenticated.'], 401) + : redirect()->guest(route('login')); } }