|
3 | 3 | namespace App\Exceptions;
|
4 | 4 |
|
5 | 5 | use Exception;
|
6 |
| -use Illuminate\Auth\AuthenticationException; |
7 |
| -use Illuminate\Validation\ValidationException; |
8 | 6 | use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
9 | 7 |
|
10 | 8 | class Handler extends ExceptionHandler
|
@@ -52,33 +50,4 @@ public function render($request, Exception $exception)
|
52 | 50 | {
|
53 | 51 | return parent::render($request, $exception);
|
54 | 52 | }
|
55 |
| - |
56 |
| - /** |
57 |
| - * Convert a validation exception into a JSON response. |
58 |
| - * |
59 |
| - * @param \Illuminate\Http\Request $request |
60 |
| - * @param \Illuminate\Validation\ValidationException $exception |
61 |
| - * @return \Illuminate\Http\JsonResponse |
62 |
| - */ |
63 |
| - protected function invalidJson($request, ValidationException $exception) |
64 |
| - { |
65 |
| - return response()->json([ |
66 |
| - 'message' => $exception->getMessage(), |
67 |
| - 'errors' => $exception->errors(), |
68 |
| - ], $exception->status); |
69 |
| - } |
70 |
| - |
71 |
| - /** |
72 |
| - * Convert an authentication exception into a response. |
73 |
| - * |
74 |
| - * @param \Illuminate\Http\Request $request |
75 |
| - * @param \Illuminate\Auth\AuthenticationException $exception |
76 |
| - * @return \Illuminate\Http\Response |
77 |
| - */ |
78 |
| - protected function unauthenticated($request, AuthenticationException $exception) |
79 |
| - { |
80 |
| - return $request->expectsJson() |
81 |
| - ? response()->json(['message' => 'Unauthenticated.'], 401) |
82 |
| - : redirect()->guest(route('login')); |
83 |
| - } |
84 | 53 | }
|
0 commit comments