我正在尝试使用请求验证上传多个文件,但验证规则未正确应用。我只想验证图像。我还设置了 mime 类型,但它不起作用。似乎是什么问题?我试过放置 'fieldname.*' 并设置 mimes,但它没有按预期工作,它甚至阻止了图像。这是我的输入字段:<input type="file" name="files[]" multiple>我的验证规则:public function rules(){ return [ 'content' => 'nullable|string|max:3000', 'files.*' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048' ];}
添加回答
举报
0/150
提交
取消