I think this is when a request is made with a request method not supported; as example, using GET on a POST only route.
You could try setting up something like this, to see if you get more info, which should put something in the app\storage\laravel.log
// Exception: MethodNotAllowedHttpException
App::error(function(MethodNotAllowedHttpException $exception) {
Log::warning('MethodNotAllowedHttpException', array('context' => $exception->getMessage()));
return Response::view('errors.show', array('code' => 'http_error_404'), 404);
});
Thanks, i will try this, it seems to be very helpful !
Unfortunately, MethodNotAllowedHttpException does not supply any information about the route or the method requested, and the exception message is null. Would be nice if it give more information by default.
TerrePorter said:
I think this is when a request is made with a request method not supported; as example, using GET on a POST only route.
You could try setting up something like this, to see if you get more info, which should put something in the app\storage\laravel.log
// Exception: MethodNotAllowedHttpException App::error(function(MethodNotAllowedHttpException $exception) { Log::warning('MethodNotAllowedHttpException', array('context' => $exception->getMessage())); return Response::view('errors.show', array('code' => 'http_error_404'), 404); });
TerrePorter said:
I think this is when a request is made with a request method not supported; as example, using GET on a POST only route.
You could try setting up something like this, to see if you get more info, which should put something in the app\storage\laravel.log
// Exception: MethodNotAllowedHttpException App::error(function(MethodNotAllowedHttpException $exception) { Log::warning('MethodNotAllowedHttpException', array('context' => $exception->getMessage())); return Response::view('errors.show', array('code' => 'http_error_404'), 404); });
Where should that code be included?
galioy said:
TerrePorter said:
I think this is when a request is made with a request method not supported; as example, using GET on a POST only route.
You could try setting up something like this, to see if you get more info, which should put something in the app\storage\laravel.log
// Exception: MethodNotAllowedHttpException App::error(function(MethodNotAllowedHttpException $exception) { Log::warning('MethodNotAllowedHttpException', array('context' => $exception->getMessage())); return Response::view('errors.show', array('code' => 'http_error_404'), 404); });
Where should that code be included?
app/start/global.php I guess ..
Just in case anyone else runs across this... I had the same problem and would get random 'MethodNotAllowedHttpException' errors with my application (Laravel 4.2) and was unable to find what page(s)/method(s) were causing the problem.
It finally dawned on me to check the Apache access_log file and match up the time. When I did this I found a web spider that was checking various pages with POST where I only had routes for GETs, so I then simply added some logic to my routes to handle that.
Hope that helps!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community