0
Eai galera!
I’m working with Laravel on a project, and I came up with a question even being (idiot). I have structured all my controllers, models and views, but I have a view called: base.blade.php
the same idea of layout.blade.php
which comes when the Laravel is installed.
In it is the whole basis of the project, and in it I inject my content, that is to say, in it the: @yield('content')
What I have to do in my view is a div that will appear on the Nav the title and description of the alert, and when clicking go to the clicked alert.
And that’s where the problem lies, as the notification div is in my layout.blade.php
cannot import an array and perform foreach.
How can I Return my controller that is accessible by base.blade.php
? Or else I would have to set in all controllers a $alerts = Alert::all();
and return to each view I create?
Print of my Nav receiving the alert data: http://prntscr.com/l08rrm (Accessed only in my alerts view).
Error accessing any other page that uses my root view base.blade.php
http://prntscr.com/l08ssz
Friend, without posting the code it is difficult to help. Post the code of your controller, base.blade.php and the view that extends the base.
– Paulo Sakamoto