tao-test/app/vendor/respect/validation/docs/rules/MinimumAge.md

24 lines
473 B
Markdown
Raw Normal View History

2022-08-29 20:14:13 +02:00
# MinimumAge
This is going to be deprecated, please use [Age](Age.md) instead.
- `v::minimumAge(int $age)`
- `v::minimumAge(int $age, string $format)`
Validates a minimum age for a given date.
```php
v::minimumAge(18)->validate('1987-01-01'); // true
v::minimumAge(18, 'd/m/Y')->validate('01/01/1987'); // true
```
Using `date()` before is a best-practice.
Message template for this validator includes `{{age}}`.
***
See also:
* [Age](Age.md)
* [Date](Date.md)