diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index b5cc5676..b944e8fd 100755 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -2,6 +2,7 @@ namespace App\Exceptions; +use Illuminate\Database\Eloquent\ModelNotFoundException; use Log; use Exception; use Illuminate\Auth\AuthenticationException; @@ -58,6 +59,11 @@ class Handler extends ExceptionHandler $http_code = $exception->getStatusCode(); } + if($exception instanceof ModelNotFoundException) { + $status = 404; + $http_code = 404; + } + return response()->json([ 'error' => [ 'code' => $exception->getCode() ,