Using Laravel 5.4 I have a form with array inputs called: coffee_kg_bags
In my form:
<input type="text" name="kg_bags[]" value="">
In my controller I do all kinds of validations and I get an error, but I don't get the old value in the form.
I entered 2 values on fields: $cof->id = 1 and $cof->id = 2
I get an error on the field with $cof->id = 1 but I don't get the old values.
In the update method in the controller:
dd(Input::get('kg_bags.2'));
Gives the value I entered
But: dd(Input::old('kg_bags.2'));
Gives null.
dd(Input::old());
Gives an empty array
Why is that?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire