Skip to content
Advertisement

@yield does not show content on Laravel

template/layout.blade.php

JavaScript

test23.blade.php

JavaScript

TestController.php

JavaScript

the variables Title and Test I’ve passed are both not showing, anyone knows how to fix?

Advertisement

Answer

@yield is used to “place” the content of a @section somewhere.

You are passing the variables via the controller into the views. So you can just use the variables as blade variables like this:

JavaScript

And

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement