Laravel. How to register global variable for my application?

Before I start, I should give you the information, that I am totally new on Laravel, so please!! Don’t shout me 🙂

I have start with Laravel a few days ago, and today I just installed the vespakoen/menu that seems to be very nice, and probably wil work for what I need it.

Just to know, currently I have installed the Laravel 5.1 on my system.

So, the problem I currently have, is where to register my menus in order to be accessible by my application, on every view.

Should I create a service provider ? Should I create a single class and included on bootstrap process ?

What is the correct way to perform this task ?

Note: The question it’s not how to install the module, but how can I have access to the $menu variable from any view from any controller

Source: laravel

Leave a Reply