Answer the question
In order to leave comments, you need to log in
How to make symfony validation not validate a field if it is null?
entity:
/**
* @ORM\Column(type="string", nullable=true)
* @Assert\Image(
* mimeTypes={ "image/jpeg", "image/png", "image/gif" },
* minWidth=200,
* minHeight=200,
* maxHeight=4000,
* maxWidth=4000,
* detectCorrupted=true,
* maxSize="8M",
* maxRatio=3,
* minRatio=0.25
* )
*/
protected $passport = null;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question