respect-validation/docs/Min.md
Henrique Moody 0338e18e83
Rename rule "Date" to "DateTime"
Also change rules to use `DateTimeInterface` and `DateTimeImmutable`
when possible.
2017-05-01 13:16:59 +02:00

698 B

Min

  • Min(mixed $minValue)
  • Min(mixed $minValue, bool $inclusive)

Validates if the input is greater than the minimum value.

v::intVal()->min(15)->validate(5); // false
v::intVal()->min(5)->validate(5); // false
v::intVal()->min(5, true)->validate(5); // true

Also accepts dates:

v::dateTime()->min('2012-01-01')->validate('2015-01-01'); // true

true may be passed as a parameter to indicate that inclusive values must be used.

Message template for this validator includes {{minValue}}.

Changelog

Version Description
1.0.0 Became inclusive by default
0.3.9 Created

See also: