indicative
indicative copied to clipboard
Field required but can accept empty string
Is it possible to validate a field to make the key mandatory but allow empty string in it?
The required
validation does check for the existence of a key but does not allow empty values.
Am i missing something here?
Thanks in advance.
For example Laravel has a present
rule for this scenario that is very useful: https://laravel.com/docs/8.x/validation#rule-present