Answer the question
In order to leave comments, you need to log in
On all pages, @yield doesn't output anything. How to share data between pages in a blade?
Once again I will try to ask a question in more detail. On all pages except layouts/app.blade.php these blocks are empty. Why? How to share yield to all pages, not just the one where I include the view.
<li>
@yield('fresh_comments')
@yield('news_month')
@yield('news_random')
</li>
Answer the question
In order to leave comments, you need to log in
Maybe you didn't specify the @extends directive in the included file? With an indication not of layouts/app.blade.php, but of the file where the yield was put.
If it does not work, then I think the @include directive will help solve the problem.
Why do you need yield anywhere other than the main template?
Describe the problem in more detail, perhaps there is a more correct and elegant solution?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question