Laravel @hasSection Directive

You can use this directive to use @yield and show the necessary tags, especially in complex layout creation, by checking if there is a section definition in subviews.

@hasSection('main-content')
    <div id="app">
        @yield('main-content')
    </div>
@endif

In this way, if the main-content section is not defined in the bottom view, the #app divi and @hasSection will not be visible, which allows you to use the layout more flexible.

Comments

There are no comments, make the firs comment