From dbdaaf7752228c4f8d6155c35c2888b8fd7b243c Mon Sep 17 00:00:00 2001 From: omair saleh Date: Sat, 5 Dec 2020 12:58:09 +0800 Subject: [PATCH] x1 and x2 reports --- app/Exceptions/Handler.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 2eb7e8c1..c036c0d6 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -3,6 +3,8 @@ namespace App\Exceptions; use Exception; +use Illuminate\Auth\Access\AuthorizationException; +use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; class Handler extends ExceptionHandler @@ -56,8 +58,8 @@ class Handler extends ExceptionHandler ], 404); } - if ($exception->getCode() === 403) { - return redirect('/'); + if ($exception instanceof AuthorizationException) { + return 'test'; } return parent::render($request, $exception);