Answer the question
In order to leave comments, you need to log in
Laravel array form field validation, why error?
Hello everyone, Laravel 5.1, so we immediately discard the option with *. See. This is how the name of my form name="center_id[1211]" looks like, and the center_id can be arbitrarily, the difference between them will be only in the number in brackets. Because all this in dynamics, I had to create a method, but first I decided to test the work manually on this field. Wrote like this
$this->validate($request, [
'center_id[1211]' => 'required'
]);
Answer the question
In order to leave comments, you need to log in
In general, everything. Array elements had to be specified through a dot
$this->validate($request, [
'center_id.1211' => 'required'
]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question