Title here
Summary here
A simple and extensible PHP validation library
Get Started →Validate single values such as strings, numbers, booleans.
$validator->validate(
value: '[email protected]',
rules: new Email(),
);
Learn more about scalar values validation →
Validate arrays of data, applying rules to individual elements.
$validator->validate(
value: ['email' => '[email protected]'],
rules: ['email' => new Email()],
);
Learn more about array validation →
Validate data objects, ensuring that their properties conform to specific rules.
readonly class SomeDto {
public function __construct(
#[Email]
public string $email,
) {}
}
$validator->validate(
value: new SomeDto(email: '[email protected]'),
);
Learn more about object validation →
Validate collections of values.
$validator->validate(
value: ['127.0.0.1', '0.0.0.0'],
rules: new EachX(new Ip()),
);