Thanks, what's the best place to put that code?
I use view composers which I usually place in app/composers.php and require at the end of app/start/global.php
that's normal, because you extends the master page !
stephanecoinon said:
I use view composers which I usually place in app/composers.php and require at the end of app/start/global.php
Thanks, i'll try with composers, but anyway, why it does inherit a variable from my master.blade.php? I am overwriting that section in a child view. Why?
heihachi88 said:
stephanecoinon said:
I use view composers which I usually place in app/composers.php and require at the end of app/start/global.php
Thanks, i'll try with composers, but anyway, why it does inherit a variable from my master.blade.php? I am overwriting that section in a child view. Why?
In my opinion, it's not the master layout's job to know about SEO or view-specific stuff, it is the controller's or view's job. What I usually do it is either use a view composer, a section or pass it from the controller. It depends on where you need the data (ie which views will consume the data).
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community