Wes
Wes

Reputation: 408

How can I find out what controller method was called in a Laravel4 NotFoundHttpException?

I am new to Laravel4 and I find it very annoying. One of my frustrations is that when I get a NotFoundHTTPException it does not tell me which Action was trying to be called! Because of this, I don't know if I have a problem with my routes.php file, whether for form's Form::open(array('url'=>'postUpload') location is bad or anything. With my previous experience with Zend the error would tell you exactly which action was trying to be called so I could troubleshoot exactly where the problem is. I feel with Laravel, I have to make changes to so many files (routes.php, blade.php, config.php, or Controller files) just to get to the bottom of which file is the culprit.

So my question is: Is there a way I can extend, or show the action that the application attempted to call on the NotFoundHttpException screen? I'm not posting any code here because it won't help the situation. I need to be able to tell which action the application is trying to call.

Thanks!!

Upvotes: 0

Views: 179

Answers (1)

Antonio Carlos Ribeiro
Antonio Carlos Ribeiro

Reputation: 87739

Yeah, this is not cool at all, I agree and also have some troubles with it, when it only shows at the log and has no other comments, no Whoops message, for example.

But... Not Found HTTP = route not found. The problem is in your routes, so take a look at the QUERY_STRING in the Whoops message, it should tell your wich one is broken.

When a controller action is not found, you'll receive a 'Controller method not found'.

Upvotes: 1

Related Questions