carlosmora
9 months ago
118
8
Laravel

Validation: date_format but not required

Posted 9 months ago by carlosmora

I want to validate an input that is not required, but if present it must have the "d/m/Y" format.

If I set the rule 'date_format:"d/m/Y"' it always fails on empty values.

How can I validate that?

Please sign in or create an account to participate in this conversation.