seferov/request-validator-bundle
seferov/request-validator-bundle is a Symfony bundle for validating incoming HTTP request data with Symfony Validator constraints. Define rules for query or body parameters, reject invalid requests early, and return clear validation errors before controller logic runs.
Architecture fit: Despite being evaluated in a Laravel context, seferov/request-validator-bundle is a Symfony bundle, not a Laravel package. Its integration surface is the Symfony HttpKernel: it reads controller annotations (docblock-style @ annotations, not PHP 8 attributes) and validates request parameters before the controller action runs. Laravel has no equivalent bundle-extension model, so there is no drop-in path — only an adapter would bridge the two, and the adapter would contain essentially all the logic worth having. The underlying idea (declarative validation declared at the controller boundary) is already served natively in Laravel by FormRequest, $request->validate(), custom Rule objects, and route middleware. Net architectural fit: effectively zero out-of-the-box; some conceptual value as a design reference.
Integration feasibility: Low. Making it work in Laravel would require: a service provider to register a middleware or controller interceptor, reflection over annotations to extract the rule definitions, and translation of those rules into Laravel's Validator contract plus Laravel-shaped 422 error responses. That is a rewrite, not an integration. Additionally, the annotation-parsing dependency (doctrine/annotations) is itself deprecated and has been superseded by native PHP attributes, meaning the parsing layer would need replacing regardless.
Technical risk: High across every dimension that matters to a TPM.
Key questions for discovery:
composer.json constraints on symfony/http-kernel, doctrine/annotations, and PHP?#[MapRequestPayload] rather than Laravel?Stack fit: Poor for Laravel — the conventions are incompatible. A Symfony bundle has no extra.laravel.providers entry, no Illuminate\Support\ServiceProvider, no Laravel middleware contract. The native Laravel equivalent covers the same requirement more idiomatically: FormRequest with rules() / authorize(), Rule objects for custom logic, and — if co-location on the controller is genuinely desired — a small custom middleware plus PHP 8 attributes on the controller method. That alternative is roughly 100–200 lines of first-party code we fully control, versus an unmaintained third-party adapter.
Migration path: Do not vendor or fork the bundle as a first move. Treat it as a design reference: read how it maps request parameters to validation constraints, then reimplement the declarative pattern with Laravel primitives. If the trigger for this evaluation is an existing Symfony service already using the bundle, isolate it behind a validation boundary (an interface with a Symfony implementation) and plan a port to Symfony attributes or a validator-constraint approach — do not extend its footprint.
Compatibility: Cross-framework reuse is not realistic. Extracting the rule-mapping logic into a framework-agnostic library means rewriting the package's core, at which point the original contributes only a starting taxonomy of constraints. Verify PHP version support explicitly before assuming any 8.2+ compatibility.
Sequencing:
Maintenance: Total ownership transfer. There is no upstream cadence to ride — the project has been dormant since January 2022. Every PHP minor version bump, every framework upgrade, and every change to annotation/attribute semantics becomes our backlog item. Realistically this is a fork-and-own commitment with no upstream relief valve.
Support: Zero support surface. With 0 dependents and 9 stars there are no Stack Overflow answers, no third-party write-ups, no issue archaeology to consult when something breaks at 2 a.m. Internal documentation and an ownership assignment are non-negotiable if it ships.
Scaling: Runtime cost is negligible — this is request-time parameter validation, a few milliseconds at most, and not a throughput concern at any realistic scale. The scaling problem is organizational: onboarding engineers onto a bespoke, obscure, undocumented bundle is a recurring tax that buys nothing over framework idioms every Laravel developer already knows.
Failure modes to plan for:
doctrine/annotations behaviors changing or disappearing under a PHP upgrade.{message, errors} structure, which breaks frontend clients and API contracts.Ramp-up: If adopted, budget 1–2 weeks of senior engineer time to understand the bundle, build the adapter, harden failure paths, and document it. That knowledge is largely non-transferable — it is specific to one abandoned package. The native alternative is a 1–2 day spike producing idiomatic, transferable, first-party code. Recommendation: decline adoption; use the package as a design reference and implement the declarative-validation pattern natively. Revisit only if discovery surfaces a requirement that FormRequest demonstrably cannot satisfy — which the evidence so far does not support.
How can I help you explore Laravel packages today?