Category: Laravel

Have you ever tried renaming a controller class or method in your Laravel Application and suddenly it goes 500 Internal Server Error? Before I show you the solution, let me show you the usual way we define routes in Laravel as documented: Then after some time, for some reason, we decided to rename the show method in the UsersController to show. We forgot to update the routes file and because most of us don’t practice TDD (we should by the way) and directly deploy this change production we now get 500 Internal Server Errors which doesn’t say much since we set APP_DEBUG to false! We then frantically open Google Docs and update our resume just in case we get fired because of this simple but frustrating issue.

Then we can now do this in our routes file: That’s it!
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners