- What does irontec/json-exception-response-bundle do?
- It is a Symfony bundle that hooks into Symfony's exception listener pipeline and converts uncaught exceptions into structured JSON error responses instead of HTML stack traces. The payload includes a status code, message, and optional debug context, so API clients receive a predictable error format in both production and development. It is lightweight and installable via Composer, but it is built for Symfony rather than as a native Laravel package.
- Can I use irontec/json-exception-response-bundle in a Laravel application?
- Not natively. Laravel has its own exception handler and does not use Symfony's HttpKernel exception listener pipeline the same way, so the bundle will not simply drop in and control Laravel error responses. Any use would be indirect and limited to legacy Laravel 7/8-era applications that resolve Symfony 5 components, and it should be proven with Composer resolution before writing integration code. For current Laravel, use Laravel's built-in JSON exception rendering instead.
- Which Laravel versions are compatible with this bundle?
- The v1.0.0 tag was published on 2019-12-11 with a note about Symfony 5 support, which hard-caps realistic compatibility at roughly the Laravel 7/8 window. Because the tag predates Laravel 7 itself, even that range is an inference to test with composer why-not rather than a documented guarantee. It is a non-starter for modern Laravel on Symfony 6 or 7.
- How do I install irontec/json-exception-response-bundle with Composer?
- Run composer require irontec/json-exception-response-bundle, preferably pinned to the exact 1.0.0 version, on a throwaway branch first so you can observe dependency resolution. In Symfony you then register the bundle in the kernel and configure its error output. In a Laravel context, installation alone does not wire it into Laravel's exception handling, so treat a successful install as only the first gate.
- Is irontec/json-exception-response-bundle still maintained?
- The only stable tag is v1.0.0 from 2019-12-11, and there has been no tagged release since, which suggests the repository is dormant or unmaintained. There is no changelog, test matrix, or maintainer statement of intent for Symfony 6/7 or current Laravel in the provided context. Treat it as a frozen dependency, not a package that will receive fixes.
- Does it support PHP 8, Symfony 6, or Symfony 7?
- A 2019 tag predates PHP 8, so expect PHP 7.x-era constraints and verify the declared PHP requirement in composer.json. The release note only points to Symfony 5 support, with no evidence of validation against Symfony 5.4 LTS or the 6/7 lines. That makes PHP 8 and modern Symfony support unlikely without a fork.
- How do I configure JSON error output and debug details?
- The bundle exposes configuration for the error output and debug details, letting you include optional context such as exception details in development while keeping production payloads minimal. Keep debug disabled in production so stack traces and internal messages are not leaked to API clients. Because the README excerpt is thin, read the bundle's config definition and source before relying on specific keys.
- What are the alternatives for consistent JSON error responses in Laravel?
- Laravel's exception handler already supports JSON rendering: return JSON from render() or rely on $request->expectsJson() to get JSON instead of HTML for API routes. You can standardize payloads with a small custom exception renderer or a response macro, which avoids adding an abandoned Symfony bundle. For Symfony applications, use Symfony's own error handling and a maintained JSON error listener instead.
- Is this bundle safe for production use?
- The technical risk is high: Symfony 5 is past end-of-life, the package has had no release activity in roughly six years, and a 2019 tag can pull in abandoned transitive dependencies or open security advisories. That is a supply-chain and unpatched-dependency exposure, not just a compatibility inconvenience. If you must use it, vendor or fork it under internal ownership and run an audit scan.
- How can I verify Composer compatibility before integrating it?
- Pin the exact version, install on a throwaway branch, and run composer why-not irontec/json-exception-response-bundle along with composer outdated --direct and composer audit. Check whether the Symfony constraint is a narrow 5.0-only pin or a ^5.0 widening that admits 5.4 LTS, and confirm the declared PHP constraint permits your runtime. Also inspect whether Symfony dependencies are direct or inherited through Laravel before assuming the package is the blocker.