Answer the question
In order to leave comments, you need to log in
Which class is responsible for handling 404 non-existent route errors?
Friends, I need a certain php code to run when a 404 error occurs. Where to put it in Laravel? I believe in handler.php before parent::render(). Or do something differently? Is there any standard?
Answer the question
In order to leave comments, you need to log in
class Handler extends ExceptionHandler
protected function renderHttpException(HttpExceptionInterface $e)
{
$status = $e->getStatusCode();
if ($status == 404) {
//code
}
return $this->convertExceptionToResponse($e);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question