A
A
axblue2016-12-17 23:37:30
Laravel
axblue, 2016-12-17 23:37:30

How to pass array to js from laravel controller?

Tell me, how are values ​​​​passed from the framework to JS?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Victor, 2016-12-17
@v_decadence

For example, like this
or something like:
var arr = {{$array}};

A
amorphine, 2016-12-18
@amorphine

Encode in json and add to the data-attribute to some element and consider it a client already.
In general, ajax is better.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question