codememory/entity-response-control
Define response prototypes to shape arrays from Doctrine entities using PHP attributes. Build API-friendly payloads with custom formatting, naming strategies, and decorators, including extra per-object data from additional queries.
jms/serializer.For Executives: "This package lets us define API responses as reusable ‘prototypes’—think of it like a blueprint for how data should look when sent to clients. Instead of writing custom serialization logic for every endpoint, we use PHP attributes to declare the structure (e.g., ‘include nested orders,’ ‘add success metrics from a separate query’). It’s faster to iterate on APIs, reduces bugs from manual data assembly, and supports complex use cases like merging entity data with external stats—all while keeping responses consistent. Low risk (MIT license) and lightweight."
For Engineers:
*"If you’re tired of writing Serializer configs or manually merging data from multiple queries, this gives you a declarative way to shape responses. Key benefits:
@Property\Nested, @FromObjectMetadata) for cleaner code.How can I help you explore Laravel packages today?