respect-validation/docs/Not.md
Henrique Moody 2a2e1d577e
Change how documentation of rules are presented
Rules are not always used from the alias `v`, neither called staticaly.
2017-03-27 17:26:21 +02:00

422 B

Not

  • Not(Validatable $rule)

Negates any rule.

v::not(v::ip())->validate('foo'); // true

In the sample above, validator returns true because 'foo' isn't an IP Address.

You can negate complex, grouped or chained validators as well:

v::not(v::intVal()->positive())->validate(-1.5); // true

Each other validation has custom messages for negated rules.


See also: