I have this validation rules and i appended some custom messages for those validations.
$this->validate($request, [
'name'=>'required',
'departments.*.name'=>'required',
'departments.*.sections.*.name'=>'required',
],[
'name.required'=>'The division name field is required.',
'departments.*.name.required'=>'The department name field is required.',
'departments.*.sections.*.name.required'=>'The section name field is required.',
]);
Screenshot of my view:
Here you can see, the empty section input field showing error message
"The department name field is required."
But it should be show
"The section name field is required."
What am i missing?
Note: i am printing the first index of all fields error messages
