mehany
1822
6
Laravel

how to use blade @stack syntax ?

Posted 3 years ago by mehany

I have a template that shares a global js script that I include at the end of the main layout file. In some templates I want to use javascript on the same file and I want to append after the global js file.

  <body>

    @include('nav.header')

    @yield('content')

    @yield('sidebar')

    @include('scripts.globals') // this renders after, just before body tag

    @yield('scripts') // this renders before scripts.globals

</body>
  

Please sign in or create an account to participate in this conversation.