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.
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.
morphTo) attributes directly to DTO classesHow can I help you explore Laravel packages today?