I want to know if it is possible to pass data from a controller, to a view that extends a master, to the master layout, without using yield/section.
example:
I have a master layout blade, that includes some common meta in the head (opengraph, schema markup) that i want to fill from a Model.
I pass a Model (lets say it's an actor model) to a sub layout that extends the master, and i want to be able to fill this mark up.
Due to the amount of data, using sections/ Yield would need too many sections (title, desc, type, image url, image width, etc...)
master.blade.php
sublayout.blade.php
I know there are View Composers, which seem the logical way to do this, But i cannot find how to inject the Model in to the view composer.
Is there a way to pass data to the master layout? either with or without a View Composers. Or is there another different way to do this?
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community