Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Dto Generator Bundle Laravel Package

svb/dto-generator-bundle

A Symfony bundle that generates typed DTO classes from your entities, arrays, or config, complete with constructors, getters, setters, and mapping helpers. A console command lets you scaffold and regenerate DTOs quickly, reducing boilerplate in your service and API layers.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit — the headline finding is a framework mismatch. Despite being catalogued as a "Laravel/PHP package," svb/dto-generator-bundle is a Symfony bundle (the -bundle suffix, DependencyInjection/ extension, and console-command entry point are the giveaway). It will not auto-register in Laravel, has no service provider, and its public surface is almost certainly a bin/console command plus container-wired generator services. The reusable core — the code-generation logic — may be framework-agnostic, but that is an assumption to verify in the source, not a property to plan around. Treat this as "a Symfony dev tool we might scavenge," not "a Laravel dependency we can install."

Integration feasibility — moderate, and only as a dev-time tool. MIT license and Composer distribution make the mechanics trivial. The favourable structural property of code generators is that they sit in require-dev: the output is committed, reviewable PHP, so the blast radius of the tool being bad is bounded to the generated files, and swapping the tool later is a re-generation exercise rather than a rewrite. That de-risks a pilot considerably. What it does not de-risk is the zero-signal problem: 0 stars, 0 dependents, 0 dependents-of-dependents means no third party has ever validated this against a stack like ours, no issue history to mine for known breakage, and no evidence of CI or test coverage.

Technical risk — high, concentrated in ownership and version lock.

  • Maintenance/abandonment: a single-vendor open-source release under an insurance-group namespace reads as "extracted internal tool," which typically means it is maintained only as far as the vendor's own needs require.
  • Framework lock: bundles of this vintage commonly pin symfony/* to a major range that conflicts with a current Laravel install (Laravel pulls symfony/console, symfony/serializer, symfony/process transitively). Composer will tell us in minutes; assume conflict until proven otherwise.
  • Generator output drift: if the tool hardcodes namespaces, base classes, or a Symfony-specific DTO parent, the generated code drags framework coupling into our domain layer — the worst kind of leak, because it arrives via committed files that look native.
  • Destructive regeneration: many generators overwrite in place. Without a documented "generate-once vs. regenerate-always" contract, hand-edits become merge casualties.
  • Supply chain: low-visibility repository; needs a vendor-security and licence-provenance pass before it touches a build.

Key questions to answer before any code is written:

  1. What is the input — Doctrine entity metadata, an existing database schema, YAML/config, or an OpenAPI/JSON Schema document? This determines whether the tool is reusable at all outside Symfony.
  2. Is the generator console-driven and dev-only, or does it register runtime services? Only the former is viable for us.
  3. Does it overwrite or skip existing files? Is there a dry-run/diff mode?
  4. Is the DTO output plain PHP (readonly properties, constructor promotion, no base class), or does it extend a bundle-provided type?
  5. PHP version and symfony/* constraint ranges in composer.json; presence of tests, CI config, and a changelog.
  6. Commit history: is this a one-off dump, or is there an active release cadence?
  7. Can the core generator be extracted and vendored if we choose to fork?

Integration Approach

Stack fit: none as-is; conditional as a fork. The honest read is that this is not a Laravel package and should not be proposed as one. There are three viable postures, in ascending order of effort:

  1. Reject and adopt a native alternative — spatie/laravel-data (DTOs with validation, casting, and Laravel-native integration) or jane-php (schema-first generation from OpenAPI/JSON Schema). Both have ecosystem signal this package lacks.
  2. Scavenge the generator core — skip the bundle entirely, pull the code-generation classes into an internal Artisan command. Viable only if Question 1 and Question 4 come back clean. Cost: we now own a fork with no upstream.
  3. Pilot the bundle in isolation — run it in a throwaway Symfony skeleton, generate DTOs for one domain, hand-port the output into Laravel. This is a research spike, not an integration.

Migration path (if we proceed past the spike). Pick one bounded, low-churn domain — a read-heavy module with a stable schema, ideally one already suffering from array-shuffling at the boundary. Generate DTOs for it, commit them, and run it for two or three schema changes. Measure: diff size per change, manual fix-up time, and whether reviewers can actually read the generated diff. That data is the go/no-go.

Compatibility work. Resolve Composer constraints against our actual PHP and Laravel versions first — this is a 15-minute check that can kill the initiative cheaply, so do it first. Confirm PSR-4 output paths are configurable to our namespace convention. Verify the generator does not require a Symfony kernel boot to run; if it does, the fork cost rises sharply.

Sequencing.

  1. Constraint and source audit (composer.json, tests, commit history) — half a day.
  2. Isolated spike in a Symfony skeleton, one domain — one to two days.
  3. Side-by-side against spatie/laravel-data on the same domain — one day.
  4. Decision: adopt / fork / reject.
  5. If adopt or fork: standardise the DTO convention first, wrap generation behind a single internal entry point (one Artisan command, one directory), and pin the tool to an exact version in require-dev.

Critical design rule regardless of outcome: generated code must land in a clearly-marked directory and the team must agree on the generate-once-versus-regenerate-always contract before the first PR. Most codegen regret is a convention failure, not a tool failure.

Operational Impact

Maintenance — we become the maintainer. With no upstream community, an upgrade to the next Laravel or PHP major becomes our problem to solve or to route around. Budget either a recurring fork-rebase cost (a day or two per framework major) or an explicit decision to freeze the tool and hand-maintain its output. The second option is often correct and should be chosen deliberately rather than drifted into.

Support. No issue triage, no security advisories, no documentation beyond the README. Ownership must be assigned to a named engineer or team, not to "the platform group" collectively — unowned dev tooling rots fast and then blocks framework upgrades. Add the repository to dependency scanning and watch upstream releases; if the vendor publishes nothing for two quarters, treat the fork as permanent.

Scaling. Runtime scaling is a non-issue: generated DTOs are ordinary PHP classes with no package dependency at execution time, so there is no performance or availability exposure in production. The scaling risk is organisational — as the domain grows, regeneration churn and merge conflicts in generated files grow with it, and a large generated diff becomes something reviewers rubber-stamp. Keep generated surface area proportional to the number of domains where DTOs genuinely pay for themselves.

Failure modes to design against.

  • Silent overwrite of hand-edited DTOs, destroying work with a clean-looking commit — mitigate with a generated-code header comment, a lint rule against editing that directory, and CI that fails on hand-edits.
  • Framework coupling leaking into the domain via generated base classes — mitigate by rejecting any output that extends a bundle-provided type.
  • Composer upgrade deadlock — the bundle pins a symfony/* range that blocks a Laravel or PHP upgrade, and the tool that was meant to save time becomes the thing blocking the roadmap. Pin exactly, and keep an exit plan.
  • Abandonment mid-adoption — mitigate by forking early if the pilot succeeds, so the exit is already taken.
  • False confidence from generated code — generation guarantees shape, not correctness; serialisation, validation, and nullability still need tests.

Ramp-up. Low for consumers: developers use the generated DTOs like any other class, no new mental model. Moderate for the owner: modifying a PHP AST/codegen tool requires familiarity with nikic/php-parser or nette/php-generator and with the tool's templates. That is a real but bounded skill investment — roughly a week for a senior PHP developer to become productive in the generator internals, assuming the code is tested. If it is untested, double that and add a strong argument for option 1.

Overall recommendation. Do not adopt this as a dependency. Run the half-day source and constraint audit; if the generator core is clean, framework-decoupled, and outputs plain PHP, consider a fork-and-own of that core behind an Artisan command — otherwise evaluate spatie/laravel-data or jane-php, which carry the ecosystem signal this package does not. The absence of stars is not disqualifying by itself, but the combination of zero dependents, a single-vendor origin, and a Symfony bundle being pitched into a Laravel context means the burden of proof sits entirely with the package, and it has not yet met it.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel