I've seen how to validate arrays in the docs. Using something like:
class UsersRequest extends FormRequest
{
public function rules()
{
'users.*.name' => 'required',
}
}
On my form I have the field named:
<input name="users[0][name]">
This is actually looped out, but have statically added it in above example.
The issue I have is that the above will validate, so if there is no value in the field, it will error, and with a value, it will pass, unfortunately the input does not have an error class on it, as I suspect the name in the error bag is different to the name on the input.
How can I correctly validate / correctly name array inputs in laravel?
Edit.
This is not a duplicate, have tried other answer on SO and they do not work.