I'm creating Laravel validation, and meet strange issue.
I have a form with input type file, where I can attach multiple files.
<input type="file" name="img[]" class="form-control" multiple="multiple">
In the Controller I have validation rules:
$validationRules = [
'img' => 'required|image'
];
And all the time my validation doesn't work, I always get a message: "The img must be an image."
There is no difference when I upload 1 file or 2 or 3 at the same time - error is the same. There are another fields at the same form (text fields) and all is ok with them, problem appears only with image. Tried to remove "image" from the validation and replace it with mimetypes or mimes - anyway system can't recognize image.
Please advice what could be a problem here, thanks a lot.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire