Answer the question
In order to leave comments, you need to log in
How to add js path to stack from PHP?
The framework allows you to add some js from the template to the stack:
@push('scripts')
<script src="...."></script>
@endpush
Answer the question
In order to leave comments, you need to log in
The trait used in the VIew facade contains the required method:
https://github.com/illuminate/view/blob/99fa4b3513...
As a result, you can add scripts to your tech from the controller or other place through:
\Illuminate\Support\Facades\View::startPush('scripts', script('./path/to/script.js'));
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question