12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- namespace App\Exceptions;
- use Exception;
- use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
- use Illuminate\Support\Facades\Log;
- use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
- class Handler extends ExceptionHandler
- {
-
- protected $dontReport = [
-
- ];
-
- protected $dontFlash = [
- 'password',
- 'password_confirmation',
- ];
-
- public function report(Exception $exception)
- {
- parent::report($exception);
- }
-
- public function render($request, Exception $exception)
- {
- if ($exception instanceof NotFoundHttpException) {
- $code = $exception->getStatusCode();
- if (view()->exists('errors.' . $code)) {
- return response()->view('errors.' . $exception->getStatusCode(), ['message' => $exception->getMessage()], 404);
- }
- }
- return parent::render($request, $exception);
- }
- }
|