phphd/exceptional-validation
Exceptional Validation brings exception-driven validation to Laravel, letting you express validation failures as exceptions handled by Laravel’s exception pipeline. Keep controllers, form requests, and domain code clean with reusable validation logic.
Architecture fit. phphd/exceptional-matcher is a small, single-purpose library for matching/asserting exceptions, with optional integrations for Laravel's Validator (surfacing ValidationFailedException and ViolationsEmbeddedException) and for UID-typed models. It belongs in the test-support layer, not the application runtime, so its architectural footprint is minimal: one dev dependency, no service boundaries, no data ownership, no deployment surface.
Integration feasibility. Adoption is a Composer install plus wiring into the test suite. The 2.0.0-rc3 changes are refactors rather than features: a single shared formatter for ValidationFailedException and ViolationsEmbeddedException, and relocation of the Validator and Uid integration classes into an Integration\ namespace. Consumers who only use the matcher API are largely insulated; consumers who imported the integration classes directly face a namespace migration.
Technical risk. Moderate, concentrated in three areas:
Validator/Uid classes into Integration\ is a breaking change for direct importers. Without class aliases or a documented upgrade path, upgrades fail at autoload time rather than at compile time, which is harder to catch.Key questions.
Integration\ namespace?Stack fit. Fits any Laravel or standalone PHP codebase using PHPUnit or Pest that needs expressive exception assertions. The Validator integration assumes Laravel's validation layer; the Uid integration assumes UID-keyed models. Teams not using those features can consume the core matcher and ignore the refactored namespaces entirely.
Migration path. Pin exactly (2.0.0-rc3) rather than floating on a range, and require minimum-stability: RC scoped to this package only. From 1.x, treat as a major upgrade: inventory every import of the old Validator/Uid classes, rewrite to Integration\, then re-run the full suite. From rc2, the diff is effectively import paths plus formatter output — a targeted find-and-replace plus an assertion audit.
Compatibility. No backward-compatibility guarantee should be assumed for an RC. Keep the dependency in require-dev; never let it reach production autoload paths. Confirm composer.json constraints against the application's PHP and Laravel versions before committing.
Sequencing.
Integration\.Maintenance. Low code footprint, but non-trivial dependency churn while in RC. Assign explicit ownership of Composer updates and track the GA milestone; each RC should be a scheduled, reviewed change rather than an automatic bump.
Support. Small open-source project with a single dominant maintainer visible in the release notes — community support only, no SLA, no vendor escalation path. Acceptable here because the blast radius is test tooling only.
Scaling. No runtime scaling considerations. At scale the cost is breadth of change: a formatter adjustment or namespace move touches every test file that asserts on exception text, so the effective change surface grows with suite size even though the package is tiny.
Failure modes.
Ramp-up. Low for engineers already fluent in PHPUnit/Pest — roughly half a day to pilot and validate. Budget one to two days for the full import refactor and assertion audit across an established suite, plus a short review cycle for each subsequent RC until GA.
How can I help you explore Laravel packages today?