我对POST请求具有以下图像验证,但我不确定如何为min_width
,min_height
和ratio
添加定制验证消息吗?
protected function getRules(): array
{
return [
'logo' => 'required|file|mimes:jpg,jpeg,png|dimensions:min_width=400,min_height=400,ratio=1/1'
];
}
答案 0 :(得分:1)
您需要这样定义您的消息:
'logo.dimensions' => 'The logo must be at least :min_width x :min_height pixels and have ratio :ratio',
答案 1 :(得分:0)
'logo.dimensions' => 'The logo must be at least 400 x 400 pixels!',
答案 2 :(得分:-1)
您的验证:
"logo" => "dimensions:min_width=400,min_height=400"
您的表单,多部分/表单数据:
<form method="POST" enctype="multipart/form-data"></form>