Repository navigation
|
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! |
Answered by
browner12
Mar 27, 2023
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 |
3 replies
Answer selected by
calebdw
|
PR was denied so nothing to do here |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This exists already (but isn't currently documented).
https://github.com/laravel/framework/blob/10.x/src/Illuminate/View/Compilers/Concerns/CompilesJs.php