PackageTrack
Sign in Get early access

respect/validation

The most awesome validation engine ever created for PHP

3.1.2 41M downloads/mo #724 most downloaded on Packagist Respect/Validation

What this package is like to depend on

Last release 1 months ago

22 Jul 2026

Release timing varies

gaps range from 9 days to 7 months

Rarely documented

notes for 6 of 154 stable releases

Nothing withdrawn

no release was ever pulled

14 years old

155 releases · first in 2012

15 releases in the last 12 months

see the full history below

Release timeline

155 releases · Apr 2012 to Jul 2026
2013 2015 2017 2019 2021 2023 2025
Release Pre-release

Releases

latest 60 of 155
  1. 3.1.2 02 Jun 2026
    Release notes

    What's Changed

    • Fix: anchor MasterCard credit-card pattern by @nikkoenggaliano in #1774
    • Bump dependencies
    • Update Regional Information

    Full Changelog: 3.1.1...3.1.2

    Open source →
  2. 3.1.1 19 Mar 2026
    Release notes

    What's Changed

    • Fix isVisible() initial value bug in NestedListStringFormatter by @alganet in #1717
    • Fix deep path chain and root template cascading bugs by @alganet in #1723
    • Bump dependencies
    • Update Regional Information

    Full Changelog: 3.1.0...3.1.1

    Open source →
  3. 3.1.0 02 Mar 2026
    Release notes

    What's Changed

    Full Changelog: 3.0.2...3.1.0

    Open source →
  4. 3.0.2 26 Feb 2026
    Release notes

    What's Changed

    • Change isValid method to public + Change validator registration by @mc7244 in #1693
    • Bump phpstan/phpstan-phpunit from 2.0.13 to 2.0.14 by @dependabot[bot] in #1694
    • Bump phpstan/phpstan-phpunit from 2.0.14 to 2.0.16 by @dependabot[bot] in #1697
    • Bump phpstan/phpstan-deprecation-rules from 2.0.3 to 2.0.4 by @dependabot[bot] in #1699
    • Bump pestphp/pest from 4.3.2 to 4.4.1 by @dependabot[bot] in #1698
    • Bump symfony/console from 7.4.4 to 8.0.4 by @dependabot[bot] in #1704
    • Bump phpstan/phpstan from 2.1.39 to 2.1.40 by @dependabot[bot] in #1705
    • Bump giggsey/libphonenumber-for-php-lite from 9.0.23 to 9.0.24 by @dependabot[bot] in #1706
    • Update Regional Information by @github-actions[bot] in #1707

    New Contributors

    Full Changelog: 3.0.1...3.0.2

    Open source →
  5. 3.0.1 10 Feb 2026

    Nothing published for this version

  6. 3.0.0 09 Feb 2026
    Release notes

    Respect\Validation 3.0

    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.0

    For detailed migration instructions, see the Migration Guide.

    Breaking Changes

    • Class and Namespace Renames:
      • Validator renamed to ValidatorBuilder
      • Rules namespace to Validators
      • Rule interface to Validator
      • Factory to ValidatorFactory
      • InvalidRuleConstructorException to InvalidValidatorException.
    • Validation Methods:
      • 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).
    • Removed Validators:
      • 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).
    • Behavior Changes:
      • Attribute replaced by Property/PropertyOptional/PropertyExists
      • Key split into Key/KeyOptional/KeyExists
      • Length and Size signatures changed to use composition (e.g., length(v::between(5, 10)))
      • Each stricter (rejects non-iterables like stdClass)
      • Composite validators (AllOf, etc.) require at least two validators
      • After (ex-Call) no longer handles callback errors
      • Contains/ContainsAny/In/EndsWith/StartsWith now strict by default
      • Url validates domains/IPs, drops news scheme, adds Email for mailto
      • New dependencies for some validators (sokil/php-isocodes, ramsey/uuid).
    • Renamed Validators:
      • Call to After
      • Callback to Satisfies
      • Min to GreaterThanOrEqual
      • Max to LessThanOrEqual
      • Nullable to NullOr
      • Optional to UndefOr
      • KeyValue to Factory
      • NotBlank 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).
    • Custom Messages:
      • setTemplate() and setName() removed (use templated() and named())
      • {{name}} placeholder renamed to {{subject}}.
    • Factory/Container: Factory replaced by PSR-11 container via ContainerRegistry.
    • Custom Validators: No longer need separate exception classes
      • use #[Template] attributes on validator classes.

    New Features

    • 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 tree
    • Attribute 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 properties
    • ShortCircuit 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']); // Passes
    • Dynamic Factory Validators: Create validators based on input.

      v::factory(fn($input) => v::key('confirmation', v::equals($input['password'] ?? null)))
          ->assert(['password' => 'secret', 'confirmation' => 'secret']); // Passes
    • Prefixed Shortcuts: Convenient wrappers for common patterns.

      v::nullOrEmail()->assert(null); // Passes
      v::allPositive()->assert([1, 2, 3]); // Passes
      v::notBlank()->assert('hello'); // Passes
    • Result 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.

    Open source →
  7. 2.5.0 22 Jul 2026
    Release notes

    Full Changelog: 2.4.12...2.5.0

    Open source →
  8. 2.4.12 08 Feb 2026

    Nothing published for this version

  9. 2.4.11 07 Feb 2026

    Nothing published for this version

  10. 2.4.10 14 Jan 2026

    Nothing published for this version

  11. 2.4.9 09 Jan 2026

    Nothing published for this version

  12. 2.4.8 06 Jan 2026

    Nothing published for this version

  13. 2.4.7 04 Jan 2026

    Nothing published for this version

  14. 2.4.6 04 Jan 2026

    Nothing published for this version

  15. 2.4.5 30 Dec 2025

    Nothing published for this version

  16. 2.4.4 07 Jun 2025

    Nothing published for this version

  17. 2.4.3 14 May 2025

    Nothing published for this version

  18. 2.4.2 12 May 2025

    Nothing published for this version

  19. 2.4.1 11 Jan 2025

    Nothing published for this version

  20. 2.4.0 07 Jan 2025

    Nothing published for this version

  21. 2.3.13 06 Jan 2025

    Nothing published for this version

  22. 2.3.12 06 Jan 2025

    Nothing published for this version

  23. 2.3.11 13 Dec 2024

    Nothing published for this version

  24. 2.3.10 05 Dec 2024

    Nothing published for this version

  25. 2.3.9 28 Nov 2024

    Nothing published for this version

  26. 2.3.8 26 Nov 2024

    Nothing published for this version

  27. 2.3.7 13 Apr 2024

    Nothing published for this version

  28. 2.3.6 24 Mar 2024

    Nothing published for this version

  29. 2.3.5 15 Mar 2024

    Nothing published for this version

  30. 2.3.4 11 Mar 2024

    Nothing published for this version

  31. 2.3.3 11 Mar 2024

    Nothing published for this version

  32. 2.3.2 02 Feb 2024

    Nothing published for this version

  33. 2.3.1 28 Jan 2024

    Nothing published for this version

  34. 2.3.0 27 Jan 2024

    Nothing published for this version

  35. 2.3.0-RC 20 Feb 2023 pre-release

    Nothing published for this version

  36. 2.2.4 15 Feb 2023

    Nothing published for this version

  37. 2.2.3 19 Mar 2021

    Nothing published for this version

  38. 2.2.2 14 Mar 2021

    Nothing published for this version

  39. 2.2.1 06 Feb 2021

    Nothing published for this version

  40. 2.2.0 06 Feb 2021

    Nothing published for this version

  41. 2.1.0 04 Oct 2020

    Nothing published for this version

  42. 2.0.17 23 Aug 2020

    Nothing published for this version

  43. 2.0.16 25 Jul 2020

    Nothing published for this version

  44. 2.0.15 21 Jul 2020

    Nothing published for this version

  45. 2.0.14 21 Jul 2020

    Nothing published for this version

  46. 2.0.13 19 Jul 2020

    Nothing published for this version

  47. 2.0.12 14 Jul 2020

    Nothing published for this version

  48. 2.0.11 12 Jul 2020

    Nothing published for this version

  49. 2.0.10 07 Jun 2020

    Nothing published for this version

  50. 2.0.9 03 Jun 2020

    Nothing published for this version

  51. 2.0.8 20 May 2020

    Nothing published for this version

  52. 2.0.7 19 May 2020

    Nothing published for this version

  53. 2.0.6 18 May 2020

    Nothing published for this version

  54. 2.0.5 18 May 2020

    Nothing published for this version

  55. 2.0.4 18 May 2020

    Nothing published for this version

  56. 2.0.3 13 May 2020

    Nothing published for this version

  57. 2.0.1 08 Apr 2020

    Nothing published for this version

  58. 2.0.0 04 Apr 2020

    Nothing published for this version

  59. 1.1.31 28 May 2019

    Nothing published for this version

  60. 1.1.30 31 Mar 2019

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive