respect-validation/docs/rules/LessThan.md
Henrique Moody 9eafe52252
Refactor the Length rule
Currently, the Length rule does multiple things, yet it's limited.
Because it does many things, it's also confusing. Turning the Length
rule into a transformation allows for way more flexibility and clarity.

The syntax becomes more verbose, but I can solve that later by creating
a Transformer enables creating rules with the "length" as a prefix.

While making this change, I also removed the support for counting
objects and integers. I find that way too confusing.

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
2024-03-19 15:38:29 +01:00

691 B

LessThan

  • LessThan(mixed $compareTo)

Validates whether the input is less than a value.

v::lessThan(10)->validate(9); // true
v::lessThan(10)->validate(10); // false

Validation makes comparison easier, check out our supported comparable values.

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

Categorization

  • Comparisons

Changelog

Version Description
2.0.0 Created

See also: