Dec 1, 2019
0
Level 8
Adding script with blade syntax in from app.js in Vue
Hi everybody, is it possible to add a javascript inline script to my html head page using javascript, in my app which uses laravel and vue I want to add the following script from the created method in my entry app.js file.
<script type="text/javascript">window.$app = {!! json_encode(app(App\Helpers\Javascript::class)->app) !!};</script>
As you can see there's some blade syntax in there.
Is it possible to do? I know I could add a partial to my master layout but something like what I'm trying to do is better/more maintaneable imo.
Please or to participate in this conversation.