Add Custom 404 page in Laravel
Copy Below Code
View As A Text File
Show Text Only
Show API
Edit Code
// app/Exceptions/Handler.php
public function render($request, Throwable $exception)
{
if ($this->isHttpException($exception)) {
if ($exception->getStatusCode() == 404) {
return response()->view('errors.' . '404', [], 404);
}
}
return parent::render($request, $exception);
}