Search code examples
phplaravel-5.3voyager

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 ?


Solution

  • Basically you just have to lowercase display names (Assuming they are identical) like name instead of Name, order instead of Order.