我在我的模型文件中尝试过以下代码但它不适用于我。
public $rules = [
'desktop_img' => 'required | mimes:jpeg,jpg,bmp,png',
'mobile_img' => 'mimes:jpeg,jpg,bmp,png'
];
public $customMessages = [
'desktop_img.required' => 'Please Upload Large Image',
'desktop_img.mimes' => 'Please Upload Valid Image',
'mobile_img.required' => 'Please Upload Small Image',
'mobile_img.mimes' => 'Please Upload Valid Image'
];
https://octobercms.com/docs/services/validation#rule-image
我已经对图像类型应用了验证,但仍然可以解决此错误
我也审查了上述链接,并尝试了这一点,但它并不适合我。
任何人都有解决方案吗?请与我分享您的知识。谢谢