-
The current practice for bringing PHP data from the backend to the frontend is using Would it be possible to create a Current: <script>
var app = {{ Illuminate\Support\Js::from($array) }};
{{-- or --}}
var app = {{ Js::from($array) }};
</script> Desired: <script>
var app = @js($array);
</script> Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
This exists already (but isn't currently documented). https://github.com/laravel/framework/blob/10.x/src/Illuminate/View/Compilers/Concerns/CompilesJs.php |
Beta Was this translation helpful? Give feedback.
-
PR was denied so nothing to do here |
Beta Was this translation helpful? Give feedback.
This exists already (but isn't currently documented).
https://github.com/laravel/framework/blob/10.x/src/Illuminate/View/Compilers/Concerns/CompilesJs.php