dbstudios/doze
Doze is a small PHP response helper built on Symfony Serializer/HttpFoundation. Configure a serializer + responder to produce encoded responses (e.g., JSON) and use its field selector/attributes support to return only requested fields in API payloads.
Adopt if:
DateTime/Object).Look elsewhere if:
laravel/serializable).For Executives: "Doze is a lightweight, open-source PHP library that lets us build REST APIs 30–50% faster by handling JSON serialization and response formatting automatically. It’s ideal for internal tools, prototypes, or non-critical APIs where we want to avoid over-engineering. Since it’s built on Symfony’s battle-tested serializer, it’s reliable for simple use cases, and the GPL-3.0 license aligns with our open-source contributions. The trade-off? We’d need to manually handle auth, validation, and complex data shapes elsewhere—but that’s a small price for rapid delivery."
For Engineers:
*"Doze drops in as a drop-in replacement for manual json_encode() in Laravel controllers. It’s perfect if:
return response()->json($data) everywhere.For Developers: *"Imagine cutting your API endpoint boilerplate from 10+ lines to 3 lines per route. Doze handles:
DateTime objects).json_encode gotchas).$responder = new Responder($serializer);
return $responder->createResponse('json', ['data' => $user]);
Caveats: You’ll still need to validate input (use Laravel’s Validator separately) and manage auth. But for CRUD APIs or internal services, this is a game-changer."*
How can I help you explore Laravel packages today?