你好,我无法用mimes:jpg,jpeg,png
验证我的图像类型
我将此发送到api
"images": [
{
"imageId": 0,
"size": 1036822,
"name": "scott-webb-hDyO6rr3kqk-unsplash.jpg",
"type": "jpeg",
"belongsTo": 0
}
]
这种类型以前是'image/jpeg'
但我得到了同样的错误:
images.0.type: Array(1)
0: "The images.0.type must be a file of type: jpeg, jpg."
这是验证:
$request->validate([
'images.*.type' => 'mimes:jpeg,jpg',
]);
尝试这个
$this->验证($request,['image'=>'image|mimes:jpeg,png,jpg,gif,svg|max:2048',](;