Laravel - Blade Templates - Stacks

Blade allows you to push to named stacks which can be rendered somewhere else in another view or layout. This can be particularly useful for specifying any JavaScript libraries required by your child views:

    
    @push('scripts')
        
    @endpush
	

You may push to a stack as many times as needed. To render the complete stack contents, pass the name of the stack to the @stack directive:

    
    
        
    
        @stack('scripts')
    
	

If you would like to prepend content onto the beginning of a stack, you should use the @prepend directive:

    
    @push('scripts')
        This will be second...
    @endpush
    
    // Later...
    
    @prepend('scripts')
        This will be first...
    @endprepend