I'm creating an array of input in my form. And i wanna get this array on my controller in Laravel.
My inputs is hidden type, and i add this fields dynamically through JavaScript, using Backbone.
I add this inputs on my form:
<input type="hidden" name="id_poi[]" class="id_poi" value="">
The value is also set dynamically in JavaScript.
After i add this input, this is my DOM:
So, i can add many inputs on my form.
When i'll handle this array on Laravel, i just get the value of the last input of this array.
I'm testing in this way:
public function store() {
var_dump(Input::all());
return;
}
And i had this output:
What i'm doing wrong to fail to get the values in an array?
EDIT:
I had other element with the same name in my form, and i change it. But the problem isn't solved yet, when i submit the form, the elements added dynamically isn't sent to PHP. Resulting in the same output above.