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 Api Bundle Laravel Package

liquidrazor/dto-api-bundle

A Laravel bundle for building API layers around data transfer objects. It helps structure request and response payloads, keep controllers thin, and maintain consistent, typed data flow between your application and its API endpoints.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit

The first finding remains a mismatch worth flagging up front: this is a Symfony bundle, not a Laravel package. It targets Symfony's HttpKernel, DI container, routing attributes, event subscribers, and StreamedResponse. There is no ServiceProvider, no Laravel middleware integration, and no facade layer. v0.1.5 does not change this — "adding support for Symfony 8" widens the supported host matrix inside the Symfony lineage; it does nothing for a Laravel host.

  • Conceptual fit is strong. DTO-first request/response modeling, streaming responses, and spec generation from the same source of truth is exactly the right shape for boring, contract-stable JSON APIs. This is the pattern Laravel teams usually assemble from spatie/laravel-data + dedoc/scramble — here it is opinionated and bundled.
  • Concrete fit depends entirely on the host framework. For a Symfony 6.4/7.x/8.x service on a compatible PHP version, this is a plausible first-class dependency. For a Laravel codebase, it remains an impedance mismatch across four layers: container, HTTP kernel, routing, and response objects.
  • The bundle's value is in the convention, not the code volume. The DTO + attribute + spec-generation triad is small enough to reimplement or wrap; that matters for the risk calculus below.

Integration feasibility

  • Symfony path: feasible, standard bundle registration, moderate effort. v0.1.5 modestly improves this by extending the forward compatibility horizon — a Symfony 8 target is no longer an automatic blocker. Main unknowns remain the serializer/validator assumptions and whether OpenAPI generation is build-time or request-time.
  • Laravel path: unchanged by this release. Not drop-in. A real integration requires a bridge that (a) registers the bundle's services into Laravel's container, (b) adapts Symfony Request/Response to Laravel's HTTP layer, and (c) reconciles routing and middleware semantics. That bridge is your code, your maintenance, and your bug surface. Symfony 8 support actually widens the conceptual gap, since the package's idioms track Symfony's direction of travel, not Laravel's.
  • Pragmatic alternative: treat the package as a reference implementation — adopt the DTO conventions and spec-generation approach, not the runtime. Lower ceiling, dramatically lower risk. This recommendation is unchanged.

Technical risk

  • Adoption risk remains the dominant risk. Still 0 stars and no dependents; no production usage to learn from, no issue history to mine, no security disclosure track record. The 8.69 score reflects metadata and description quality, not ecosystem validation — do not read it as a maturity signal.
  • Abandonment risk is marginally improved. v0.1.5 is evidence of a maintainer who is still present and tracking framework releases. That is a genuine, if narrow, positive signal — the single most common failure mode for a package like this (bit-rot at the next framework major) has been deferred at least one cycle. It is not evidence of a roadmap, a bus-factor plan, or a security process.
  • API stability: still unknown, with a new caveat. We now have a short patch-release history (0.1.x) rather than a single release, which slightly helps, but there is still no changelog depth, no UPGRADE/CHANGELOG visibility described, and no stated versioning policy. A framework-support change landing in a patch release (0.1.5) is a semver-hygiene yellow flag: if the composer constraint was widened (^6.4|^7|^8), that is additive and safe; if it was bumped (dropping 6.x/7.x), that is a breaking change shipped without a minor-version signal. Pre-1.0 packages carry no semver guarantees regardless, so pin exactly either way.
  • Low blast radius if scoped. Because the surface is narrow (DTOs, streaming, spec), a contained adoption is reversible.

Key questions

  1. Did v0.1.5 widen or replace the Symfony constraint? Specifically: are Symfony 6.4 and 7.x still supported, and did the PHP floor move (Symfony 8 implies a materially higher PHP minimum)? This is the single question this release raises and the first thing to check in composer.json.
  2. Does the DTO and OpenAPI layer function standalone, without the Symfony HTTP kernel? (Determines whether a Laravel adapter is thin or thick.)
  3. Is OpenAPI generation build-time/cacheable, or per-request reflection?
  4. Test coverage, CI status, and static analysis level? Is there a composer.json conflict pin that will block framework upgrades?
  5. How does the OpenAPI generator handle enums, nullable/union types, generics, discriminators, and error envelopes?
  6. Streaming semantics: how are mid-stream errors surfaced, and is there backpressure or heartbeat handling?
  7. License, security contact, and maintainer commitment/roadmap? Is there a changelog, and is there a stated versioning policy?
  8. Overlap or conflict with API Platform if already present?

Verdict on v0.1.5: worth incorporating, not worth re-scoring. It nudges the Symfony-path risk down and leaves the Laravel-path conclusion untouched. It does not change the adopt/wrap/borrow decision.

Integration Approach

Stack fit

  • Best fit: Symfony 7.x, or Symfony 8.x if your PHP floor allows it, plus PHP per the package's constraint; greenfield or well-bounded JSON API surface; Symfony Serializer already in use.
  • Acceptable fit: Symfony 6.4 LTS — only if the 0.1.5 constraint change confirms 6.4 is still supported. Verify directly, do not infer.
  • Poor fit: Laravel/Lumen as a runtime dependency; anything with an existing API Platform or JSON:API contract; teams without Symfony experience.
  • Equivalent-buy vs. build check: if the host is Laravel, benchmark against spatie/laravel-data + dedoc/scramble before committing to a bridge. The functional overlap is high and those are battle-tested.

Migration path

  1. Vendor audit first — read the source and composer.json, not the README. Confirm the framework coupling points, the exact Symfony/PHP constraint sets, and the license. One day, one engineer.
  2. Spike on a single non-critical endpoint in a sandbox branch. Measure: lines of glue code required, generated spec fidelity, streaming behavior under a slow client.
  3. Decide: adopt, wrap, or borrow. Adopt for Symfony (7.x, or 8.x if you are already there); wrap for Laravel only if the spike shows a thin adapter; borrow (conventions only) as the default for Laravel.
  4. Never migrate the existing API surface. Apply to the next new bounded context or a single versioned namespace. Do not retrofit an existing contract.

Compatibility

  • Pin the exact version (0.1.5), not a caret range. There is still no release history long enough to reason about semver behavior, and pre-1.0 carries no guarantees.
  • Diff the 0.1.5 constraint block against 0.1.4 before upgrading. Confirm whether Symfony 6.4/7.x support was retained or dropped, and whether the PHP floor moved. A framework-support change in a patch release is exactly the case where you read the diff rather than the release note.
  • If you are on Symfony 8, treat 0.1.5 as the minimum viable version; earlier releases cannot be assumed to work.
  • Confirm OpenAPI 3.0 vs 3.1 output and diff the generated spec against your current published spec before any client consumes it.
  • Check serializer and validator coupling — if the bundle assumes Symfony Serializer, a Laravel app using its own casts will produce silent divergences.

Sequencing

  1. Vendor audit, constraint diff (0.1.4 → 0.1.5), and license/security review
  2. Sandbox spike on one endpoint, including a streaming failure test
  3. Go/no-go decision with the fork-ownership cost stated explicitly
  4. If go: add OpenAPI spec diff to CI before the first endpoint ships
  5. Staging rollout with a feature flag and a hand-written fallback path
  6. Production on a single low-traffic surface; reassess at 30 days against maintenance burden actually incurred, and again at the next framework major

Operational Impact

Maintenance

  • Assume you may own this code. Budget a named maintainer and a forked-vendor policy (patch releases applied internally, upstream PRs as best-effort).
  • Pin the version exactly. No caret ranges on a package still in 0.1.x.
  • Framework upgrades remain coupled, but the coupling window has moved: supporting Symfony 8 means a Symfony 8 upgrade is no longer blocked by this dependency. That is a real reduction in standing risk — and it is also the only kind of risk this release addresses.
  • Track the release cadence, not just the release content. One patch is a data point; a consistent cadence over two or three framework cycles is a pattern. Revisit the abandonment assessment at the next Symfony major.

Support

  • Effectively zero external support: no issue corpus, no Stack Overflow answers, no third-party tutorials. All knowledge is internal and must be written down during the spike while it is cheap.
  • Documentation is a single README plus terse release notes ("Adding support for Symfony 8" is a one-liner with no compatibility guidance). Treat the source and composer.json as the specification and record the conventions your team adopts in your own API guidelines.

Scaling

  • Streaming is the differentiator and the operational trap. Long-lived streams occupy PHP-FPM workers for their full duration — size the pool for peak concurrent streams, not peak RPS, or move the streaming endpoints to a runtime with better concurrency characteristics. Verify behavior under RoadRunner/Swoole/FrankenPHP if that is the target.
  • OpenAPI generation cost must be build-time. If it is per-request reflection, it will show up as a latency tax under load and must be cached or moved to CI.
  • Streaming does help memory profile materially on large payloads — that is the legitimate win.
  • Neither scaling characteristic is affected by 0.1.5.

Failure modes

  • Mid-stream exception after headers are sent → truncated JSON with a 200 status. Clients cannot distinguish this from success without content-length or envelope validation. Every streaming client needs a completion sentinel.
  • No status code available after first byte → application errors during streaming must be encoded in-band; document this contract explicitly.
  • Client retries after truncation → duplicate side effects on non-idempotent streams. Enforce idempotency keys on streaming endpoints.
  • OpenAPI drift if spec generation is not gated in CI — the whole value proposition collapses quietly.
  • Silent DTO/serializer divergence in a bridged Laravel integration: fields become null rather than erroring.
  • Constraint surprise on upgrade — a framework-support change shipped in a patch release can silently drop the Symfony version you are pinned to. Read the diff, run composer why-not in CI.
  • Abandonment still blocks framework and PHP upgrades eventually; the cost lands all at once, at the worst time. Deferred, not eliminated.

Ramp-up

  • Symfony + DTO-experienced team: low — a day to first endpoint. This is genuinely the "boring" pitch delivered.
  • Symfony 6.4 team considering the package now: verify first — confirm your version is still in the constraint set before spending any ramp-up time.
  • Laravel-only team: medium-high — they must learn both the package's conventions and enough Symfony internals to maintain the bridge. That second cost is ongoing, not one-time, and is usually underestimated.
  • Either way, the hidden conventions (error envelopes, streaming contract, spec generation triggers) must be documented internally in the first week or they become tribal knowledge.
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.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core