I am currently working on a laravel project. I need to redirect all error pages to a page with 404 pages not found.
public function render($request, Exception $exception) { if ($this->isHttpException($exception)) { switch ($exception->getStatusCode()) { // not authorized case '403': return \Response::view('404',array(),403); break; // not found case '404': return \Response::view('404',array(),404); break; // internal error case '500': return \Response::view('404',array(),500); break; default: return $this->renderHttpException($exception); break; } } else { return parent::render($request, $exception); } return parent::render($request, $exception); }
Can I redirect the error page to page 404 ?. Also, verification errors are not displayed in this code (redirecting to 404 when verification errors occur). I am using version 5.4.
source share