Посмотрите, сможете ли вы найти альтернативу этому. У меня есть @stack ('header_scripts'), и я хочу отрисовать оттуда несколько скриптов, таких как <scripts></scripts>
на моем сайте.
Например, это мой master_page.blade.php :
<head>
@stack('header_scripts)
</head>
А это мой index.blade.php:
<div class="promotion">
-45% DISCOUNT!
@push('header_scripts')
<script>
//show promotion and send data to Google Anlytics from here
</script>
@endpush
</div>
<div class="container>
//some products list here
@push('header_scripts')
<script>
//show all the products and send data to Google Anlytics
</script>
@endpush
</div>
и т. Д. И т. Д.
Проблема заключается в том, что последний push-код в стек перезаписывает первый push-код.
Как я могу это сделать?