Could you filter first in controller, then pass any extra info to view with a with-> ?
Thats not the way you want filters to work. How does a filter determine what pages a user has acces to? Maybe something in the user model? Or a service? Use that in your view.
That's exactly the way I use filters because the controller passes everything to view. At some point you need to decide which view to show, an admin or a regular user. The controller to me is the best place to do this. I use separate views one for admin and another for users. But look at this====https://laracasts.com/discuss/channels/general-discussion/laravel-filters-in-blade
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community