You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want an image to only be required when a user is creating a model. I also want the image to have a certain minimum width and height. If a user updates a model, they will not need to select an image again, but if they do, the same validation rule for minimum width and height is applied.
I am encountering an issue when updating a model and I dont set an image. The minimum width and height validation rules is always triggered, even though the image is not required. Am I setting the validation rules correctly? What validation rules should I use?
The validation rules I am using are as follows:
'image' => array(
'required' => 'create',
'minWidth' => array(
'rule' => array('minWidth', '680'),
'message' => 'Photo must be at least 680 pixels wide'
),
'minHeight' => array(
'rule' => array('minHeight', '460'),
'message' => 'Photo must be at least 460 pixels tall'
)
),
The text was updated successfully, but these errors were encountered:
I want an image to only be required when a user is creating a model. I also want the image to have a certain minimum width and height. If a user updates a model, they will not need to select an image again, but if they do, the same validation rule for minimum width and height is applied.
I am encountering an issue when updating a model and I dont set an image. The minimum width and height validation rules is always triggered, even though the image is not required. Am I setting the validation rules correctly? What validation rules should I use?
The validation rules I am using are as follows:
'image' => array(
),
The text was updated successfully, but these errors were encountered: