Black Friday: the Laravel testing course is $149 instead of $249, through Dec 7. See the course →
logo

Drop a route parameter your controller doesn't need

Let the middleware finish the job

Joel Clermont
Joel Clermont
2026-05-22

From our daily Laravel tips email. Get the next one in your inbox.

If you've prefixed your routes with something like /{lang} or /{tenant}, you can run into a situation where controllers in that group have to declare the parameter, even when they don't use it.

In today's video, I show a one-line fix in the middleware that lets you keep the controller signatures clean.

Watch Now (3 min)

And after watching, don't forget to subscribe to our YouTube channel, so you don't miss future videos.

Here to help,

Joel

P.S. A fresh set of eyes finds little wins like this. Get a Laravel code review.

Want a tip like this in your inbox every weekday?

Each one takes less than 2 minutes to read. Join 4,000+ Laravel developers who already get them.

email
No spam. Only real-world advice.
Toss a coin in the jar if you found this helpful.