In Laravel 5, App::missing
and App::error
is not available, so how do your catch exceptions and missing pages now?
I could not find any inf
Laravel ships with default error page, You can easily add custom error pages like this
1 - Create an error view in view -> errors folder
2 - The name must match HTTP errors like 404 or 403 500
`Route::get('/page/not/found',function($closure){
// second param is optional
abort(404, 'Page Not found');
});`
Angular HTML5 mode could cause a bunch of missing pages (user bookmark few page and try to reload). If you can't override server settings to handle that, you might thinking of override missing page behaviour.
You can modify \App\Exceptions\Handler render method to push content with 200 rather than push 404 template with 404 code.
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
if ($this->isHttpException($e) && $e->getStatusCode() == 404)
{
return response()->view('angular', []);
}
return parent::render($request, $e);
}