macpaw/request-dto-resolver
macpaw/request-dto-resolver automatically maps incoming Laravel request data into typed DTOs, cutting boilerplate and keeping controllers clean. It resolves DTO constructor parameters, supports nested objects, and makes request handling more explicit, predictable, and easy to test.
What it is. macpaw/request-dto-resolver is a Symfony bundle, not a Laravel package. It adds a request value-resolver that maps HTTP request data (route params, query string, body) into typed DTO objects declared as controller action arguments, removing hand-written $request->get(...) hydration and pushing type coercion/validation into the framework's argument-resolution phase. The first decision a TPM must make is whether the target application is actually Symfony — because the framing here ("Laravel/PHP package") does not match the artifact.
Current release status (v1.1.2). A patch release containing a single functional change: restore route attribute lookup for DTO parameter resolution. This is non-breaking — no new features, no deprecations, no API changes. Two implications matter for a TPM: (a) upstream is actively maintained and regressions are turned around quickly, which modestly improves the continuity picture; (b) a regression in a core resolution path (route-attribute-bound DTOs) escaped into the 1.1.x line, which confirms that upstream's own test coverage of resolution paths is not a sufficient safety net for adopters. The practical output is a version floor of 1.1.2 and stronger justification for the contract-test gate already recommended below.
Architecture fit.
ArgumentResolver/ValueResolver pipeline, which is the idiomatic extension point. Integration is a bundle registration plus DTO classes; there is no service, database, or middleware to operate.HttpKernel argument resolvers for controller actions; it uses its own container-based method injection and route-model binding. Making this work under Laravel means reimplementing the resolution step inside a service provider or a custom Route/controller dispatcher, at which point you have adopted a dependency for its DTO semantics rather than its integration.Integration feasibility. Mechanically simple in Symfony: composer require, register the bundle, add a DTO type-hint to a controller signature. There is no infrastructure footprint — the repo's own agent notes confirm there are no runtime services, databases, or web servers, only CLI tooling. The real effort is not installation; it is deciding the contract for mapping, validation, and error responses, which this package influences but does not fully own.
Technical risk.
composer.lock is correct for a library, but it means composer install resolves fresh dependency versions — CI can break on an unrelated Symfony minor release.Key questions to resolve before adoption.
Stack fit. Treat this as a Symfony-native component. Confirm PHP version floor and Symfony major (6.x/7.x) alignment against the application's composer.json before anything else. For a Laravel codebase, the honest comparison set is native FormRequest + a data-object library (e.g., spatie/laravel-data), not this bundle — the cost/benefit favors the native path unless there is a concrete reason to standardize on Symfony's resolver contract across services.
Migration path.
Request injection coexist without conflict. Include at least one route-attribute-bound DTO in the first batch, since that path is the most recently demonstrated to be fragile.RequestDtoFactory interface and implement it twice — once wrapping this bundle, once wrapping the Laravel equivalent. That abstraction is the migration insurance policy.Compatibility. Set the constraint floor at ^1.1.2 and explicitly exclude 1.1.0/1.1.1 if route-attribute-bound DTOs are in scope. Verify: declared Symfony component constraints, PHP version, interaction with the application's serializer/validator configuration (custom normalizers, validation groups, DateTimeInterface handling), and behavior under the framework's error handler. The absence of a lock file means pinning exact versions in the consuming application and running the library's own composer phpstan / composer phpunit gates in a canary build before bumping.
Sequencing.
Maintenance. No runtime footprint — nothing to deploy, monitor, or page on. The maintenance burden is dependency hygiene: watching an upstream repo with 1 star and no dependents means you are the de facto QA. v1.1.2 is a positive data point (a regression was diagnosed and shipped quickly), but it is one data point; budget a named internal owner, a pinned version policy, and a periodic upstream review. A vendor fork remains a reasonable contingency given the project's size; the codebase is small enough that forking is cheap.
Support. Community-only, no SLA, no commercial backing evident. Escalation path is "read the source" and, increasingly, "watch the releases page" — upstream responsiveness is demonstrated but not contractual. For a low-criticality, request-hydration concern this is acceptable; for anything on a regulated or high-availability path, it needs an internal owner and a documented fallback (hand-written hydrators).
Scaling. Per-request CPU cost is small and constant; the resolver runs once per action and does not affect horizontal scaling, connection pools, or queue throughput. Confirm metadata/reflection caching is enabled so cost does not scale with DTO complexity. The realistic scaling concern is organizational: as more endpoints adopt the pattern, consistency of DTO design and validation rules becomes the bottleneck, not the library.
Failure modes to design for.
composer update → behavior change with no changelog signal.Ramp-up. For Symfony developers: hours. The concepts (DTO, value resolver, validation) are standard. For Laravel-only teams: the ramp-up is not the library, it is the Symfony mental model — days, plus the bridge work, which is where the real cost sits. Either way, invest in two artifacts before broad rollout: a short internal style guide for DTO design (types, nullability, validation placement) and a set of contract tests that pin the request-to-DTO behavior so a future swap or fork is verifiable rather than hopeful. The v1.1.2 release is the argument for those contract tests, not against them.
TPM recommendation. Viable and low-risk if and only if the target is Symfony. The 1.1.2 patch is reassuring on maintenance velocity and neutral on architecture; it does not change the decision, but it does set a hard version floor (^1.1.2) and sharpen the case for per-parameter-source contract tests. Under Laravel, the adoption cost exceeds the benefit and a native approach is the better product decision. Regardless of path, gate adoption behind the internal abstraction, an explicit security policy for property population, and a defined error contract — those three decisions matter more than the library itself.
How can I help you explore Laravel packages today?