I am having a form and I have an array of input fields for video urls, now when I validate form if I have multiple invalid fields with video urls, I get the same message for eac
I think this will help you if you are using "name=location[]" this in your view page.
for ($i = 0; $i <= sizeof($location); $i++) {
$this->validate($request,
[
// set the rules
'location.'.$i => 'required',
'contact_no.'.$i => 'required',
'email.'.$i => 'required|email',
],
[
// set your custom error messages here
'location.'.$i.'.'.'required' => 'Contact no. is required',
'contact_no.'.$i.'.'.'required' => 'Contact no. is required',
'email.'.$i.'.'.'required' => 'Email is required',
'email.'.$i.'.'.'email' => 'Please enter valid email address'
]);
}