Reputation: 264
I have been asked to implement auth in a L5.4 application, which features some 30 routes and 16 controllers. Which is the shortest yet laravel-liest way to protect with auth all routes? Thanks in advance
Upvotes: 2
Views: 1097
Reputation: 11906
Use route groups and add the middleware to the group. Therefore every route defined inside the route group would use the middleware.
https://laravel.com/docs/5.4/routing#route-groups
Upvotes: 1