I have a problem with laravel 4
. I want to handle occurred errors like, 404 Not Found
or any other errors. But I want to call a controller when such errors occurs. I've tried this:
App::missing(function($exception)
{
return Response::view('errors.404', array('error'=>$exception), 404);
});
But actually above code is not my purpose, I want something like this:
//I know this code doesn't work, I've just wanted to show the claim
App::missing('HomeController@error');
App::error('HomeController@error');
// or ...
Is there any way to handle errors within calling a specific controller's method?
Nothing's going to stop you from creating an instance of your controller and calling the method you want to call.
App::missing(function($exception)
{
return App::make('HomeController')->error($exception);
});
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