jessarcher/laravel-castable-data-transfer-object
A Laravel package that lets Eloquent models cast attributes directly to data transfer objects, keeping structured data typed and clean while handling JSON serialization automatically. Ideal for replacing loose arrays with explicit DTO classes.
spatie/data-transfer-object as a dependency. It's a strong fit for teams enforcing strict typing at the model boundary.Attribute accessors/mutators, or Laravel's built-in AsArrayObject/AsCollection casts already cover the use case.How can I help you explore Laravel packages today?