I am new in Laravel, and currently coding an intranet app, which is basically a dashboard with a lot of informations, with Laravel 5.2, and one of the requirements is to be able to navigate thu different stores. Each page of the app, will require the CODE of store.
Currently I have a column store_id in all my tables, and I use GET with routes to retrieve this value, like:
www.mysite.com/1/employees -> will list all employees from Store 1
www.mysite.com/1/employees/create -> will create employee to Store 1
www.mysite.com/2/financial -> will list all financial widgets with data from Store 2
I would like to remove my STORE_ID from the GET, and use a DROPDOWN select with all stores in my topbar.blade.php, for example:
<select>
<option selected>Store1</option>
<option>Store2</option>
</select>
Whenever someone select "Store1" or "Store2", I would like to get the Store information, using StoreController and make this variables available to all controllers and views. Where I can use the following URL
www.mysite.com/employees -> will list all employees from "Depending of the SELECT"
www.mysite.com/employees/create -> will create employee to "Depending of the SELECT"
www.mysite.com/financial -> will list all financial widgets with data from "Depending of the SELECT"
I have read about View Composer, Facades, ServiceProvide, and I got really confused about all of them.