awurth/slim-validation
A validation package for Slim that provides a validator service and middleware, built on Respect/Validation. Define rules for request data, collect error messages, and keep controllers clean.
$collection[] = $value now appends instead of throwing on ValidationFailureCollection and ValidatedValueCollection. If we build custom error aggregators or merge failures across nested validations, this removes a silent implementation constraint. Relevant to any decision to expose a documented error envelope to API consumers.array.Adopt when:
Validator::validate().AsserterInterface extension point, so domain-specific assertions live behind a stable contract instead of ad-hoc helper functions.Caveats to plan for on upgrade to v5.1.0:
rules option now throws the package's own InvalidPropertyOptionsException rather than Symfony's InvalidOptionsException. Any catch block, error handler, or test asserting on the old type needs updating. This is the highest-risk item in the release for us.AsserterInterface::assert() signature. The discarded third argument is no longer passed. Custom asserter implementations that declared that parameter as required will need a signature change. First-party usage is unaffected.Look elsewhere when:
FormRequest/Validator and nothing needs validated-value objects or cross-entry-point reuse — the framework already covers this at zero dependency cost.For executives: This is a maintenance release for a mature library, not a capability launch. It widens platform support — we can now move to Symfony 8 without waiting on this dependency — and fixes two genuine bugs, one of which was silently preventing validators from reading route arguments from PSR-7 requests. That bug fix is the one with commercial relevance: it lets us reuse a single validation layer across our HTTP surfaces instead of maintaining parallel rule sets. Scope is roughly one upgrade ticket plus test review. No migration project, no new infrastructure, no vendor conversation.
For engineering: Low-drama upgrade with two things to grep for. First, swap any catches of Symfony's InvalidOptionsException to the new InvalidPropertyOptionsException. Second, audit custom AsserterInterface implementations — assert() no longer receives the third argument, so required third parameters must be dropped. Everything else is additive: Symfony 8 constraint, collection append semantics fixed, PHPDoc array shapes added, and a corrected call signature in Validator. Recommend running the full suite plus a static-analysis pass, since the new PHPDoc types may surface pre-existing shape mismatches in our integration code — that's a benefit, but it will show up as new CI noise if we don't anticipate it.
Standing recommendation: note in the dependency register that 5.1.0 contains behaviorally breaking changes despite being a minor bump. We should be reviewing changelogs for this package rather than relying on version numbers.
How can I help you explore Laravel packages today?