passing PHP values to JS in Laravel blade
Correct way to pass values to
JS
is to use
!!
directives:
<script>
        
    change_asset_category('{!! $category_values !!}');

</script>
The result will be:
<script>
        
change_asset_category('{"version":"vers","patch_level":"patc","bcp_dr":"bcp\/d"}');

</script>
by Valeri Tandilashvili
4 years ago
Laravel
0
Pro tip: use ```triple backticks around text``` to write in code fences