Closed jakewhiteley closed 6 months ago
Oh, actually ignore me - it does work, but some of my uploads were errors due to max_upload_size being reached. Closing issue.
@jakewhiteley There is a rule to validate uploaded files, however if you are allowing multiple files, you should set this as an array and then add validation rules to each element e.g.:
[
'portfolioImages' => 'sometimes|array|max:5',
'portfolioImages.*' => 'uploaded_file|max:2M|mimes:jpeg,png',
]
I recommend checking the rule documentation for handling multiple file uploads.
I am doing this:
But this doesnt validate the total count of uploaded files.
I could change it to be
'portfolioImages.name' => 'max:5'
which would error if 6 images are uploaded, but I believe it is much more sensible behaviour for the max rule to work by validating the total count of files for that key.