Support the ongoing development of →
posted 2 weeks ago

Right now if laravel does that, it wouldn't help much since laravel terminates the request if it fails at middleware level. I mean it does not fallthrough to a different route. Additionally its best that each route is self documenting and unique per endpoint otherwise you'll have bugs to deal with on the long run.

Perhaps the issue you're facing can be solved another way and would be:

  • /admin/users
  • /commissioner/users

The benefit for above is

  • better documentation
  • Isolated functionality
  • Easy to apply middlewares strictly to each route


  • /all/users (UsersController)

And then in the controller you can make a check to see if its admin. I would definitely recommend the first one unless you must do it this way.

Last updated by @omitobi 1 week ago.

hdyadav liked this reply


Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.