how to use directive @push in blade template laravel

You just need to make that the opposite way, @push is meant to be in the child view, which is pushing content to the parent @stack directive.

So your index.blade.php should have a:


And your child view:

    <script type="text/javascript" src="{{ URL::asset ('js/custom-scripts.js') }}"></script>

You can also use @parent directive with @section like this:


    <!-- The rest of your scripts -->

If you need more info I’d recommend you to check the documentation. Hope this helped you.

Leave a Comment