Level 27
@orjan Have a look at view composers: https://laravel.com/docs/7.x/views#view-composers
1 like
Hello there.
I'm new to laravel. Been following the basics here on laracasts and reading some more.
I got the spatie/laravel-menu package to build a menu system from code to just add in to the template. But where should I create the menu code?
A main menu for the whole site I don't want to do for each and every controller/method, as it is global. I just want it to be placed in an appropriate place.
Now I actually do it in the routes/web.php, which feels wrong. It should be in every request, so where should it be built?
@orjan Have a look at view composers: https://laravel.com/docs/7.x/views#view-composers
Please or to participate in this conversation.