mattjanssen/api-response-bundle
A PHP bundle for building consistent API responses, with helpers for standardized success and error payloads so your application returns clean, predictable JSON across endpoints.
App\Http\Responses/response macros, Illuminate\Foundation\Exceptions\Handler::render, API Resources for serialization, and a shared error-envelope class. Build cost is small (days, not weeks) and the result is framework-idiomatic.sensio/framework-extra-bundle 5, and modernizes the test stack (symfony/phpunit-bridge, Mockery 1, JMS serializer bundle 2/3). That partially retires the "abandoned since 2019" objection. But the headline constraint is untouched — "php": "^5.4|^7" still excludes PHP 8. On a PHP 8+ runtime (any current Laravel, and Symfony 5.4/6 in practice), this package cannot be installed at all. So the call moves from "abandoned" to "alive but structurally incompatible with our runtime."spatie/laravel-fractal, laravel-responses-style helper packages, JSON:API tooling (cloudcreativity/json-api), or plain Laravel Resources. A v1.0.0 bump does not change which option is the ecosystem default for us.framework-extra-bundle 5 are now in range).^5.4|^7 blocks installation outright — no override short of forking and maintaining the fork.^2.4|^3|^4|^5 range still stops at Symfony 5, and sensio/framework-extra-bundle is itself deprecated in the Symfony ecosystem in favour of native attributes.To executives: We re-reviewed this package after its v1.0.0 release and our recommendation is unchanged: do not adopt it as a dependency. The new version is a real maintenance signal — it adds Symfony 4/5 support and modernizes its test tooling, which answers our earlier "is this abandoned?" concern. But it still declares PHP 5.4/7 only, so it cannot run on our PHP 8 stack, and it remains a Symfony component in a Laravel product. We will implement the same pattern in-house with standard Laravel features: days of engineering, no long-term maintenance liability, and the API consistency our consumers and integration partners need.
To engineering: Credit where due — v1.0.0 is not a no-op. Symfony 5 and sensio/framework-extra-bundle 5 are now supported, PHPUnit moved to symfony/phpunit-bridge, and Mockery/JMS serializer ranges were widened. That's a maintainer doing the right things. It still doesn't reach us: "php": "^5.4|^7" excludes PHP 8, which is a hard install blocker on any current Laravel runtime, and the Symfony-only bundle wiring translates poorly. The core insight — funnel both controller returns and exceptions through one transformer — remains worth copying. On Laravel that's an exception render() mapping, a response-envelope helper, and API Resources; roughly 2–4 days, fully idiomatic, tested, ours to evolve. Fork the concept, not the code.
How can I help you explore Laravel packages today?