- Is gchernikov/request-resolver-bundle compatible with Laravel?
- No. It is a Symfony bundle that hooks into Symfony's HttpKernel argument-resolver pipeline to hydrate request DTOs and inject them as controller arguments. Laravel has no bundle system and no equivalent ArgumentResolver chain, so it cannot be installed as a direct Composer dependency in a Laravel app. Only the pattern is portable, using FormRequests, route bindings, or a container resolving callback.
- How do I install gchernikov/request-resolver-bundle?
- In a Symfony application you would install it with Composer and register the bundle in your bundles configuration, then configure resolvers for your OpenAPI attributes. The repository is small and readable, so review the source and composer.json before committing. Do not attempt to install it in a Laravel project, because the Symfony kernel integration will not be exercised there.
- Which Symfony and PHP versions does request-resolver-bundle support?
- The package's Symfony and PHP constraints should be verified directly in its composer.json before any adoption. The technical evaluation flags version support as an open question, with no evidence of a broad CI matrix across Symfony LTS releases. For a Laravel port, assume PHP 8.1 or newer so constructor property promotion and readonly properties are available.
- How does request-resolver-bundle map incoming HTTP requests to DTOs?
- It uses Symfony's argument-resolver mechanism to construct request DTOs based on OpenAPI attributes and inject them into controller actions. That decouples request shaping and routing concerns from the controller body. In Laravel the closest equivalents are FormRequest subclasses, route-model binding, and container-based controller method injection.
- What happens when request DTO validation fails in request-resolver-bundle?
- The evaluation lists validation-failure behavior as a key question for the maintainer: the bundle may throw an exception, return a 400 response, or delegate to another layer. Confirm the actual behavior in the source before relying on it. In a Laravel port, handle this through FormRequest's failedValidation hook to return a consistent 422 JSON response.
- Can I use request-resolver-bundle as a reference for typed request DTOs in Laravel?
- Yes, as a pattern source rather than a library. Read the small source to understand how DTOs are hydrated and passed as controller arguments before the controller body runs. Then implement an in-house package using FormRequests plus a route binding or container resolving hook, so your team owns the contract and tests.
- How should I test a Laravel port of the request-resolver pattern?
- Write feature tests against real endpoints that assert the typed DTO is injected and that invalid input returns the expected status code. Unit test the hydrator or resolver in isolation with mocked request data. Because the original bundle shows little test or CI evidence, do not assume its edge-case behavior is covered.
- Is request-resolver-bundle safe to use in production?
- Vendor and maintenance risk are high: one star, zero dependents, a single maintainer, and no evidence of production usage. Request DTO hydration touches user input, so an unaudited resolver is a security surface a technical lead should not silently accept. For Laravel, prefer a small internal package with real tests over adding this dependency.
- What are the Laravel alternatives to request-resolver-bundle?
- Laravel's FormRequest, route-model binding, and container-based controller method injection cover most typed-request needs. For a closer analogue, use a lightweight middleware that swaps the request for a typed DTO, or a Route::bind or container Resolving callback. The bundle's concept is portable without taking on the Symfony dependency.
- Should a Laravel team adopt request-resolver-bundle or port the pattern?
- Port the pattern. The package is a Symfony bundle with no Laravel integration path and high vendor and maintenance risk. Run a short spike to read the source, then a one-sprint prototype against two or three real endpoints to see whether typed DTOs beat plain FormRequests. Ship the result as an in-house package so the team owns the tests and upgrade path.