dragon-code/api-response
Build consistent Laravel API responses with a fluent, macro-friendly builder. Dragon Code's api-response helps you return success and error payloads, HTTP status codes, and resource collections in a uniform JSON shape, cutting boilerplate and keeping endpoints predictable.
data / meta / errors, stable error codes, consistent HTTP status mapping) instead of ad-hoc controller returns. This is a cross-cutting contract decision that affects every consumer-facing endpoint and every SDK/client built on top.dragon-code/support dependency (6.0) plus a docs update — no new capabilities, no stated security fixes. The honest framing remains that this is a design reference, not a dependency. The build estimate for an equivalent internal formatter is small relative to the integration, upgrade, and fork-ownership risk of adopting an abandoned library.response()->json(), and exception handler already cover this ground with zero added dependency. This package is only relevant as prior art.Consider it (narrowly) only when all of the following hold:
Look elsewhere — or build in-house — when any of these apply:
dragon-code/support to 6.0 may carry its own PHP/Symfony floor changes; verify the transitive version matrix before anything else, and do not assume a 2026 release has been validated against the Symfony and PHP versions you run.For executives: This is a small, MIT-licensed library for standardizing API responses. A new major version (v10.0.0) has been published, but it contains only an internal dependency upgrade and documentation edits — no new features and no security fixes. We are still not recommending it as a dependency: it is effectively unmaintained, with negligible adoption, and the v10.0.0 release actually illustrates the problem — a breaking version number with no user-facing value. What we are taking from it is the pattern — a consistent response envelope with stable error codes — which we can implement internally at low cost and keep under our own maintenance. Net effect: we get the consistency benefit and avoid the supply-chain and ownership risk of an abandoned third-party package. No license spend; modest one-time engineering effort; no ongoing vendor exposure; recommendation unchanged by the new release.
For engineering: Treat dragon-code/api-response as a reference implementation, not a dependency. It is Symfony-targeted, has no dependents, and spent years dormant before shipping v10.0.0 — a major bump whose entire changelog is "bump dragon-code/support to 6.0" plus doc updates, meaning the breaking-change surface exists purely for a transitive dependency migration. If we are on Laravel, the framework already gives us the primitives; the work is a response formatter plus a global exception renderer, plus a written contract doc and tests. If we are on Symfony and want the shortcut, pin down the transitive PHP/Symfony compatibility matrix first and compare against a maintained alternative. Recommended decision: build the thin internal layer, cite this package as design prior art, and record the rejection rationale in the architecture decision log — including the v10.0.0 review — so it does not get re-litigated on the next release.
How can I help you explore Laravel packages today?