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

fresns/dto

Fresns DTO provides a simple, typed data transfer object layer for Laravel/PHP applications. Define structured payloads, transform and validate data, and serialize cleanly to arrays or JSON for APIs, requests, and service boundaries.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy on the data-transfer layer. fresns/dto is a small, focused dependency that standardizes how typed payloads move between HTTP requests, service/domain layers, and JSON responses. Adopting it removes a recurring "we'll just write our own DTO base class" decision from every new service or API surface, and replaces bespoke glue code with a maintained, versioned contract.
  • API surface consolidation and versioning. Consistent DTO serialization is what makes an API contract predictable across teams and clients. If the roadmap includes public/partner APIs, mobile clients, or a v2 of an existing API, this is the kind of dependency that keeps response shapes from drifting endpoint-by-endpoint.
  • Integration and webhook work. Any roadmap item involving inbound third-party payloads or outbound event dispatch benefits from explicit, validated transfer objects rather than associative arrays passed by convention. Reduces integration defects that only surface in production.
  • Onboarding and code review throughput. Typed DTOs make the boundary between "untrusted input" and "domain object" legible to new engineers and to reviewers. This is a soft benefit but a real one when scaling a team against a mature Laravel codebase.
  • Maintenance posture signal. v1.3.3 is a patch release against the 1.3.x line with no documented breaking changes, deprecations, or new features. Read as: the package is in an active-but-stable maintenance rhythm, the public API is settled, and the upgrade cost from 1.3.2 is effectively zero. That is a positive signal for a dependency you intend to sit underneath your API layer for multiple quarters — but it is also the reason not to treat this release as a feature unlock.

When to Consider This Package

Consider adopting when:

  • You are already on Laravel/PHP 8.1+ and are using (or moving toward) typed properties and constructor promotion; the package's value scales with how much of your codebase is already type-aware.
  • You have more than a handful of endpoints, or more than one consumer of your data (mobile app, SPA, partner integration), and response-shape consistency is becoming a coordination cost rather than a coding task.
  • You are standardizing patterns across multiple services and want a shared, low-ceremony convention for request→domain→response mapping that reviewers can point at.
  • You want a dependency that is small enough to read in an afternoon and, if necessary, fork. Single-purpose packages in the DTO space are usually replaceable; that lowers the lock-in risk of the buy decision.

Look elsewhere or defer when:

  • Your application is small, your team is one or two engineers, and plain arrays or a handful of hand-written classes are already working. The coordination benefit does not materialize at that scale, and the abstraction adds indirection for no measurable gain.
  • You need heavy schema-first or codegen-driven contracts (OpenAPI/Protobuf/GraphQL codegen). A DTO base package complements those workflows but does not replace them; if codegen is the actual requirement, evaluate that category first.
  • You are on an older PHP version, or on a framework major that pins you below what the package's 1.3.x line supports. Verify compatibility explicitly before committing; the changelog for v1.3.3 does not restate platform requirements, so confirm against the package's composer constraints rather than assuming.
  • Your organization requires a formal security review or SLA-backed support for third-party code. This is an open-source, single-maintainer-ecosystem package (Fresns); the risk is not quality, it is bus factor and support expectations. If those are hard requirements, the honest answer is to budget for internal ownership — fork, pin, and vendor — or choose a commercially supported alternative.
  • You are already deep into a competing convention (e.g., spatie/laravel-data) across the codebase. Migrating for marginal ergonomic differences is not a product decision worth making mid-flight.

Adoption criteria to satisfy before committing: pin to a caret constraint on 1.3; run a spike converting two representative endpoints (one read, one write) and measure code removed versus indirection added; confirm the team agrees on where DTOs live and that they will not leak into Eloquent models; document the convention in the repo so the pattern does not fork per engineer.

How to Pitch It (Stakeholders)

For executives (one paragraph): This is a small, stable open-source library that makes the data flowing through our Laravel APIs explicitly typed and consistently shaped. It is not a platform bet — it is a convention with a version number, which means the pattern survives engineer turnover instead of living in tribal knowledge. The decision it unlocks is whether we keep hand-rolling the same mapping code in every new endpoint or standardize once. The v1.3.3 release we just reviewed is a patch with no breaking changes, no deprecations, and no new features; it confirms the library is maintained and its interface has settled, and it carries no upgrade cost. Cost is low, reversibility is high (the package is small enough to replace or vendor), and the primary risk is maintainer concentration rather than technical quality — mitigated by pinning the version and treating it as internal once adopted.

For engineering (summary): fresns/dto gives us typed transfer objects for the request→domain→response path in Laravel. v1.3.3 is a maintenance patch — safe to take on 1.3.x with no code changes and no migration work; nothing in the changelog suggests behavioral changes, so treat the risk as negligible and the release as a routine bump. The real work is not the upgrade, it is the decision and the convention: pick where DTOs live, agree they never substitute for domain models, and convert one read and one write endpoint as a spike before we commit broadly. If the spike shows more ceremony than it removes, we stop there — the exit cost is one dependency and a handful of classes.

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.
teamzac/geocoder
ideatica/config-writer
keaton-php/pipe-dream
jacksonwebservices/laravel-user-suite
maksimru/conditional-laravel-debugbar
gismatul/nova-support-chat
gismatul/laravel-support-chat
networkrailbusinesssystems/oracle-api
alphabalex/messaging-made-easy
rawphp/warp
shootkiran/merobug
narakode/fineauth
numencode/wn-syncops-plugin
ibnnajjaar/mib-global-pay
ably/pubsub-server
mstfkhazaal/defender
mfonte/base62x
karnoweb/metapilot
tobya/bcsapiwrapper
swalker2/cpanel