Level 47
Remove the brackets in your photo validation.
Hello all,
I have my request set up, I'm trying to apply some validation to my file input that allows for multiple uploads.
{{-- Photo(s) --}}
<div class="form-group">
{!! Form::label('photos', 'Photo(s):') !!}
{!! Form::file('photos[]', ['multiple']) !!}
</div>
With the following rules in my request.
public function rules()
{
return [
'females' => 'required',
'photos[]' => 'required|image'
];
}
And some custom messages.
public function messages()
{
return [
'females.required' => 'You must select at least one female.',
'photos[].required' => 'You must select at least one photo before attempting to upload.'
];
}
Now when I try to upload a file - or multiple - it always throws the required validation? Why?
Does Laravel's validation not work for multiple file fields?
Please or to participate in this conversation.