I want to generate a dynamic menu in a sidebar and share with all the views in Laravel 5.1.
like:
- Marks Module
- Langosh Topic
- Content 1
- Content 2
-Nitzsche Topic
- Content 3
- Rolfson Module
Although All this elements belong another entity called course which I can select in the Top menu (users can have more than 1 course).
So every time that I access, Course, Module, Topic or Content they need to tell the sidebar menu which course is the father (or grandfather) of all of those kids to generate the menu.
in AppServiceProvider I have view composer and everything's working fine, but I am using sessions to get the course ID, and I don't like to idea.
How can I pass the $course to the Service Provider or is there any other better way to do that?