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
For laravel 7.x, I have found the following solution. You can basically use 'field.rule' => 'message'
public function rules()
{
return [
'user.*.firstname' => 'string|required',
];
}
And then in the messages (I use a FormRequest for all requests):
public function messages()
{
'user.*.firstname.required' => 'Firstname of the user is required',
}
You can also pass a translation string like 'passwords.user'
to the message.