From 134eafd12cde2e0d7b6ebea8b42b5454a20afda3 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 19 Jul 2017 17:45:57 -0500 Subject: [PATCH] remove things that aren't usually customized --- app/Exceptions/Handler.php | 31 ------------------------------- 1 file changed, 31 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 8da7515a..7e2563a8 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -3,8 +3,6 @@ namespace App\Exceptions; use Exception; -use Illuminate\Auth\AuthenticationException; -use Illuminate\Validation\ValidationException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; class Handler extends ExceptionHandler @@ -52,33 +50,4 @@ public function render($request, Exception $exception) { return parent::render($request, $exception); } - - /** - * Convert a validation exception into a JSON response. - * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Validation\ValidationException $exception - * @return \Illuminate\Http\JsonResponse - */ - protected function invalidJson($request, ValidationException $exception) - { - return response()->json([ - 'message' => $exception->getMessage(), - 'errors' => $exception->errors(), - ], $exception->status); - } - - /** - * Convert an authentication exception into a response. - * - * @param \Illuminate\Http\Request $request - * @param \Illuminate\Auth\AuthenticationException $exception - * @return \Illuminate\Http\Response - */ - protected function unauthenticated($request, AuthenticationException $exception) - { - return $request->expectsJson() - ? response()->json(['message' => 'Unauthenticated.'], 401) - : redirect()->guest(route('login')); - } }