respect-validation/docs/rules/Max.md

39 lines
722 B
Markdown
Raw Normal View History

2015-01-30 09:40:06 +01:00
# Max
- `Max(mixed $compareTo)`
2015-01-30 09:40:06 +01:00
Validates whether the input is less than or equal to a value.
2015-01-30 09:40:06 +01:00
```php
v::max(10)->validate(9); // true
v::max(10)->validate(10); // true
v::max(10)->validate(11); // false
2015-01-30 09:40:06 +01:00
```
Validation makes comparison easier, check out our supported
[comparable values](../comparable-values.md).
2015-01-30 09:40:06 +01:00
Message template for this validator includes `{{compareTo}}`.
2015-01-30 09:40:06 +01:00
## Categorization
- Comparisons
## Changelog
Version | Description
--------|-------------
2.0.0 | Became always inclusive
1.0.0 | Became inclusive by default
0.3.9 | Created
***
2015-01-30 09:40:06 +01:00
See also:
- [Between](Between.md)
- [GreaterThan](GreaterThan.md)
- [LessThan](LessThan.md)
2018-12-11 13:31:50 +01:00
- [MaxAge](MaxAge.md)
- [Min](Min.md)
2018-12-11 13:31:50 +01:00
- [MinAge](MinAge.md)