I have users that can enter information for different companies on a application. So i put a dropdown at the nav level which can be filled (foreach loop) from the controller that calls the index.blade, with something like this:
$companies = Assignment::where('id',Auth::user()->id)->get() return view(user.index, compact('companies')
I have not tried it yet, but i think it should work. My question is: every time that i call a new view from a different controller, i will need to add the $companies and pass it to the view. Is there like a global way to do this?