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
Laravel Dto Tools

Laravel Dto Tools Laravel Package

honeystone/laravel-dto-tools

Honeystone's Laravel DTO Tools provides a lightweight base DTO with validation, casting, serialization, and Eloquent integration, making it easy to move typed, validated data between requests, services, and models in Laravel applications.

View on GitHub
Deep Wiki
Context7

A comprehensive set of DTO Tools for Laravel.

Frequently asked questions about Laravel Dto Tools
What is honeystone/laravel-dto-tools used for?
honeystone/laravel-dto-tools provides a lightweight base DTO for Laravel applications with validation, casting, serialization, and Eloquent integration. It is intended to replace ad hoc arrays and raw request payloads with typed, testable objects. Teams typically use it in action or service layers, modular monoliths, and other explicit application boundaries. It should not be treated as a domain-modeling framework or a replacement for Eloquent entities.
How do I install honeystone/laravel-dto-tools in a Laravel app?
Install it with Composer using composer require honeystone/laravel-dto-tools. Laravel package auto-discovery should register the service provider, and you can publish optional config or stubs if the package documents them. After installation, generate DTO classes or extend the provided base DTO for your use case. Check the package README for exact generator commands and publishing tags.
Which Laravel and PHP versions does laravel-dto-tools support?
The supported Laravel and PHP versions are defined by the package's Composer constraints and CI matrix, so verify those before adoption. The available context does not list a specific version range, and low public adoption means you should test against your team's PHP and Laravel versions. Pin the package version and run your application test suite, static analysis, and upgrade checks in CI. Treat Laravel upgrades as a compatibility gate until the package is proven in your stack.
How does laravel-dto-tools handle validation and casting?
The package supplies a base DTO with validation and casting so you can define rules and typed attributes instead of passing arrays around. Exact rule syntax, cast behavior, and serialization semantics should be confirmed in the README and with a small spike. Test edge cases such as nullable fields, nested DTOs, collections, and JSON boundaries. Keep DTO tests close to the generated or handwritten classes so behavior stays explicit.
Can I use laravel-dto-tools with Eloquent models?
Yes, Eloquent integration is one of the package's stated features, helping move typed, validated data between requests, services, and models. The recommended pattern is to use DTOs at application boundaries and keep Eloquent models responsible for persistence. Confirm how the package maps attributes, handles relationships, and serializes to JSON before using it broadly. Avoid replacing existing domain entities with DTOs just because the package makes generation easy.
Does laravel-dto-tools support nested DTOs and collections?
Nested DTOs and collections are a key area to validate because the available technical assessment flags them as possible edge-case risk. The package may support them, but you should confirm documented behavior and write tests for nested validation, casting, and serialization. Run a time-boxed spike with realistic payloads before standardizing on a pattern. If support is unclear, keep a hand-written fallback for complex nested structures.
Is laravel-dto-tools suitable for production use?
It can be suitable for production when the team owns the dependency and treats it as a small, replaceable utility. MIT licensing is favorable, but 51 stars and a low composite score indicate limited public evidence of long-term maintenance and edge-case coverage. Pin the version, test in CI, monitor upgrades, and document a fallback to hand-written DTO base classes. Start with new code in one bounded context rather than rewriting working models or domain objects.
How do I test DTOs created with laravel-dto-tools?
Test DTOs as normal PHP objects by instantiating them, asserting validation failures, checking cast values, and verifying serialization output. Add integration tests for Eloquent mapping and JSON boundaries if you use those features. Include static analysis with PHPStan or Psalm and formatting with Pint in CI. For generated DTOs, test the generated result and the generator behavior your team depends on.
What are alternatives to honeystone/laravel-dto-tools?
Common alternatives include hand-written DTO base classes and established packages such as spatie/laravel-data, depending on your validation, casting, and mapping needs. Hand-written DTOs offer maximum control and no external maintenance risk, while packages can reduce boilerplate. Evaluate alternatives against your Laravel version, static-analysis requirements, nested DTO support, and team conventions. A small pilot comparing generated and handwritten DTOs is the safest way to choose.
How is laravel-dto-tools maintained and what are the upgrade risks?
Expect community-only support with no commercial SLA, and plan for internal ownership of upgrades and documentation. The main maintenance risks are package abandonment, Laravel or PHP upgrade incompatibility, breaking generator changes, and undocumented edge cases. Use lockfiles, automated dependency updates, upgrade tests, and an internal runbook. Keep a documented path to replace the package with local DTO base classes if maintenance stalls.
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.
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect