RaffaeleT
RaffaeleT

Reputation: 264

Laravel auth on multiple routes at once

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

Answers (1)

Sandeesh
Sandeesh

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

Related Questions