NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #761 most downloaded on Packagist
The most awesome validation engine ever created for PHP
Last release 2 months ago
22 Jul 2026
Release timing varies
gaps range from 9 days to 7 months
Rarely documented
notes for 6 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
14 years old
155 releases · first in 2012
Fix: anchor MasterCard credit-card pattern by @nikkoenggaliano in #1774
Full Changelog: 3.1.1...3.1.2
Fix isVisible() initial value bug in NestedListStringFormatter by @alganet in #1717
Full Changelog: 3.1.0...3.1.1
One column per quarter.
Introduce Trimmed validator by @alganet in #1702
Bump phpstan/phpstan-deprecation-rules from 2.0.3 to 2.0.4 by @dependabot [bot] in #1699
Full Changelog: 3.0.1...3.0.2
Nothing published for this version
Respect\Validation 3.0 is a major release with breaking changes, improved performance, and new features for more flexible validation. This version req…
Respect\Validation 3.0 is a major release with breaking changes, improved performance, and new features for more flexible validation. This version requires PHP 8.5+ (up from 8.1+ in 2.x). Update via:
composer require respect/validation:^3.0For detailed migration instructions, see the Migration Guide.
Validator renamed to ValidatorBuilderRules namespace to ValidatorsRule interface to ValidatorFactory to ValidatorFactoryInvalidRuleConstructorException to InvalidValidatorException.validate() now returns a ResultQuery object instead of a boolean (use isValid() for boolean checks)check() and assert() now throw a unified ValidationException (validator-specific exceptions removed; NestedValidationException removed).Type (use specific type validators like stringType())Yes/No (use trueVal()/falseVal())KeyNested (use nested key())Age/MinAge/MaxAge (use dateTimeDiff())PrimeNumber/Fibonacci/PerfectSquare/FilterVar/Uploaded (use satisfies())VideoUrl (no direct replacement).Attribute replaced by Property/PropertyOptional/PropertyExistsKey split into Key/KeyOptional/KeyExistsLength and Size signatures changed to use composition (e.g., length(v::between(5, 10)))Each stricter (rejects non-iterables like stdClass)AllOf, etc.) require at least two validatorsAfter (ex-Call) no longer handles callback errorsContains/ContainsAny/In/EndsWith/StartsWith now strict by defaultUrl validates domains/IPs, drops news scheme, adds Email for mailtosokil/php-isocodes, ramsey/uuid).Call to AfterCallback to SatisfiesMin to GreaterThanOrEqualMax to LessThanOrEqualNullable to NullOrOptional to UndefOrKeyValue to FactoryNotBlank inverted to Blank (use not(v::blank()))NotEmpty inverted/renamed to Falsy (use not(v::falsy()))NoWhitespace inverted/renamed to Spaced (use not(v::spaced()))IterableType to IterableVal (stricter IterableType now exists separately).setTemplate() and setName() removed (use templated() and named()){{name}} placeholder renamed to {{subject}}.Factory replaced by PSR-11 container via ContainerRegistry.#[Template] attributes on validator classes.Result-Based Validation: validate() returns a ResultQuery for detailed error inspection.
$result = v::numericVal()->positive()->between(1, 255)->validate($input);
$result->hasFailed(); // bool
$result->getFullMessage(); // All errors as treeAttribute Validation: Validate object properties via PHP attributes.
class User {
#[Validators\Email] public string $email;
#[Validators\Between(18, 120)] public int $age;
}
v::attributes()->assert($user); // Validates all annotated propertiesShortCircuit Validation: Stops at first failure for dependent checks.
v::shortCircuit(
v::key('countryCode', v::countryCode()),
v::factory(fn($input) => v::key('subdivisionCode', v::subdivisionCode($input['countryCode'])))
)->assert(['countryCode' => 'US', 'subdivisionCode' => 'CA']); // PassesDynamic Factory Validators: Create validators based on input.
v::factory(fn($input) => v::key('confirmation', v::equals($input['password'] ?? null)))
->assert(['password' => 'secret', 'confirmation' => 'secret']); // PassesPrefixed Shortcuts: Convenient wrappers for common patterns.
v::nullOrEmail()->assert(null); // Passes
v::allPositive()->assert([1, 2, 3]); // Passes
v::notBlank()->assert('hello'); // PassesResult Composition: Nested results for clearer messages (e.g., all(v::intType()) → "Every item must be an integer").
Paths in Errors: Full dot-notation paths for nested failures (e.g., .mysql.host must be a string).
Helpful Stack Traces: Traces point to user code, not library internals.
Custom Exceptions: Pass exceptions to assert().
v::email()->assert($input, new DomainException('Invalid email'));Placeholder Pipes: Customize template rendering (e.g., {{haystack|list:or}} → "active" or "pending").
Symfony Translation: Uses Symfony contracts for message translation.
New Validators: All, BetweenExclusive, ContainsCount, DateTimeDiff, Formatted, Hetu, KeyExists, KeyOptional, Named, PropertyExists, PropertyOptional, Templated.
For more details, see the Feature Guide, Validators List, or open an issue on GitHub.
Full Changelog : 2.4.12...2.5.0
Full Changelog: 2.4.12...2.5.0
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →