laravel 404 not found code example
Example 1: how to set 404 page in laravel
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
{
if ($this->isHttpException($exception)) {
if ($exception->getStatusCode() == 404) {
return response()->view('errors.' . '404', [], 404);
}
}
return parent::render($request, $exception);
}
Example 2: error 404 not found
Check this cool 404 error page!
https://codepen.io/DevLorenzo/pen/poEXVZp