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 Morph Cast

Laravel Dto Morph Cast Laravel Package

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.

View on GitHub
Deep Wiki
Context7

hdaklue/laravel-dto-morph-cast adds type-safe DTO casting to Laravel's polymorphic relationships. Instead of juggling raw morph type strings and IDs, define a custom Eloquent cast that resolves the morphable model into a dedicated DTO, letting your application code work with predictable, autocompleted objects rather than loose arrays.

  • Cast polymorphic (morphTo) attributes directly to DTO classes
  • Configurable morph map and class resolution
  • Plugs into existing Eloquent models with minimal setup
  • Keeps models lean by moving presentation logic into DTO boundaries
  • Framework-native cast registration for a familiar Laravel workflow
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.
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
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
adachsoft/php-code-style