respect-validation/docs/rules/Nullable.md
Henrique Moody 4fd26e39bb
Rename "NotOptional" to "NotUndef"
Since I've already renamed the "Optional" rule to "UnderOf," it makes
sense to rename this rule too.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2024-05-06 20:45:27 +02:00

476 B

Nullable

  • Nullable(Validatable $rule)

Validates the given input with a defined rule when input is not NULL.

v::nullable(v::email())->validate(null); // true
v::nullable(v::email())->validate('example@example.com'); // true
v::nullable(v::email())->validate('not an email'); // false

Categorization

  • Nesting

Changelog

Version Description
2.0.0 Created

See also: