hdaklue/laravel-dto-morph-cast
A Laravel package that casts Eloquent model attributes into DTO classes, morphing between raw database values and typed data transfer objects for cleaner, safer model attributes.
CastsAttributes implementations (and their test coverage) or adopt a maintained package for this single, well-bounded capability.Adopt when:
composer.json supports (confirm before committing — the release notes give no compatibility signal).Look elsewhere / defer when:
For executives: This is a small, low-risk Laravel utility that makes one specific part of our data layer — polymorphic relationships — produce clean, typed objects instead of loose, error-prone structures. The latest release (v1.1.2) is a routine patch with no new features or breaking changes, so it doesn't affect scope, cost, or timeline. Adopting it is a tactical "buy vs. build" call that saves us writing and maintaining custom plumbing; the main diligence item is confirming release-note transparency and Laravel-version support before we standardize.
For engineering: Single-purpose package for morph-to-DTO casting. v1.1.2 is patch-only with no changelog detail — review the 1.1.1→1.1.2 diff, confirm supported Laravel/PHP versions in composer.json, and pin it. Recommend a short spike on one real morph relation (e.g., comments or attachments) to confirm it fits our DTO conventions before wider rollout.
How can I help you explore Laravel packages today?