0

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 ?

Rahul
  • 1,617
  • 1
  • 9
  • 18
Raff
  • 5
  • 2
  • 12

1 Answers1

2

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

Arafat Rahman
  • 574
  • 3
  • 11
  • 27