How do I validate the values in an array from a request? I have the following rules
public function rules()
{
return [
'firstname.*' => ['required', 'string', 'max:45'],
'surname.*' => ['required', 'string', 'max:45'],
'email.*' => ['required', 'string', 'email', 'max:45'],
'phonenumber.*' => ['required', 'string', 'max:45'],
'name' => ['required', 'string', 'max:45', 'unique:organisations'],
'info' => ['required', 'string'],
'address' => ['required', 'string', 'max:45'],
'housenumber' => ['required', 'string', 'max:10'],
'postalcode' => ['required', 'string', 'max:7'],
'place' => ['required', 'string', 'max:45'],
'password' => ['required', 'confirmed']
];
firstname, surname, email and phonenumber are arrays with the following input
<input name="firstname[]">
<input name="surname[]">
<input name="email[]">
<input name="phonenumber[]">
The other validation field work just fine. I tried the answer from this post: How to validate array in Laravel?
however it doesn't work for me. What am I missing or doing wrong?