ascetic-soft/rowcast
Lightweight PDO DataMapper for PHP 8.4+ that maps DB rows to DTOs and back via reflection. Supports auto or explicit mappings, type conversion, and a fluent query builder with dialect-aware UPSERT.
toArray()/toJson() methods) or licensing proprietary tools like JSON:API libraries.toArray()/toJson() methods in Eloquent models.Array.prototype.map hacks).For Executives:
"This package cuts 30–50% of the boilerplate code in our Laravel APIs by automating data serialization—freeing engineers to build features faster. For example, instead of writing 10+ lines of toArray() per model, we’d use a declarative config to shape responses dynamically. It’s a low-risk, high-reward tool to modernize our data layer without rewriting existing logic."
For Engineering: *"Rowcast lets us define once how our Eloquent models should serialize to arrays/JSON, then reuse that logic everywhere—APIs, queues, or internal services. Key benefits:
toArray(): Centralize casting rules in a single place.user.with('posts')->cast()).For Architects: *"This addresses a common anti-pattern in Laravel apps: fragmented serialization logic. By standardizing casting via a single package, we:
array_merge/json_encode hacks.How can I help you explore Laravel packages today?