I am trying to upload multiple files with a request validation but the validation rule is not applying correctly. I want only images to be validated. I set also the mime types but it is not working. What seems to be the problem?
I have tried putting 'fieldname.*' and set mimes but it is not working as expected it is blocking even images.
Here is my input field:
<input type="file" name="files[]" multiple>
My validation rule:
public function rules()
{
return [
'content' => 'nullable|string|max:3000',
'files.*' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
];
}