i don't think you need a custom handler, since if you check the app\bootstrap\app.php you'll find a singleton bound to the App\Exceptions\Handler::class where in the render method you could handle everything.
add you exception class to the protected $dontReport array
and in the render method do something like
if ($e instanceof ModelNotFoundException) {
$e = new NotFoundHttpException($e->getMessage(), $e);
}
I can't find any instance of a handle() method in any of the classes relevant to the App\Exceptions\Handler::class. Where can I find this method?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community