简体   繁体   中英

Laravel voyager validation

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 ?

基本上,您只需要小写显示名称(假设它们是相同的),例如name而不是Nameorder而不是Order

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM