I try to use validation in Laravel Voyager. When I set validation rule for image like
{
"validation": {
"rule":
"required|image|mimes:jpeg,png,jpg,gif,svg|max:2048|dimensions:width=500,height=500"
}
}
Though I have select an image it always shows an error The default img field is required.
But If I remove the required
part from the validation rule like
{
"validation": {
"rule": "image|mimes:jpeg,png,jpg,gif,svg|max:2048|dimensions:width=500,height=500"
}
}
Then it doesn't show any error though I have select an image with below dimension.
Is there any error ?
答案 0 :(得分:0)
基本上,您只需要小写显示名称(假设它们相同),例如name
而不是Name
,order
而不是Order
。