I am new to Laravel and I'm trying to catch any requests that do not match existing routes. Currently I am getting a ...
Symfony \ Component \ HttpKernel \ Exception \ NotFoundHttpException
I have created an App::missing()
handler in the app/start/global.php
as described on the documentation page but that doesn't help. I also tried creating an App::error(function(NotFoundHttpException $exception, $code)
handler, but that didn't help either.
Any help would be appreciated.
You need this: In 'app/start/global.php' add:
App::missing(function($exception)
{
return Response::view('errorView', array(), 404);
});
And of course in views create (in this case) errorView.blade.php
EDIT: This method handle all "404 Not Found" errors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With