phauthentic/problem-details-symfony-bundle
A Symfony bundle that turns exceptions and errors into RFC 7807 problem details JSON responses, wiring the phauthentic problem-details library into your app so APIs return consistent, spec-compliant error payloads with minimal configuration.
Assessment basis: This is a Symfony bundle, not a Laravel package, and it is evaluated here against a Laravel/PHP estate. That framing determines almost everything below. The bundle (1 star, 0 dependents, last release 2025-02-11, MIT) exists to wire the framework-agnostic phauthentic/problem-details library into Symfony's kernel exception handling. The underlying concept — RFC 9457 (which obsoletes the RFC 7807 named in the description) problem documents with type, title, status, detail, instance — is genuinely valuable for any HTTP API. The bundle is not the deliverable we would consume.
Architecture fit
services.yaml autoconfiguration. The bundle's core value — an exception listener registered into Symfony's kernel.exception event — has no automatic equivalent. Adoption in Laravel means either (a) using the framework-agnostic base library directly and writing our own renderer, or (b) forking the listener logic. Neither is "install and go."symfony/http-kernel, symfony/dependency-injection, or a second PSR-7/PSR-17 stack, because that is how a small error-formatting package becomes a framework-adjacent liability.withExceptions() in bootstrap/app.php, which is coarse and easy to over-apply — a single bad mapping can reshape every 500 the app returns.Response/JsonResponse semantics for one code path, which produces inconsistency rather than standardization.Integration feasibility
type URI → status/title mapping), and the serializer. These are small, testable, and framework-neutral.symfony/serializer if used for normalizers) versus our matrix. A symfony/serializer dependency in a Laravel app is a real footprint decision — Laravel ships its own JSON encoding path, and running two serialization stacks for error responses is a smell.Content-Type is application/problem+json, not application/json — clients and API gateways key off that.Technical risk
instance field and verbose detail strings are the classic way internal hostnames, file paths, and stack fragments leak into client-facing errors. Any adoption must specify redaction rules before the first production deploy.application/problem+json with a specific type URI vocabulary, changing that vocabulary is a breaking API change for consumers. The package choice is reversible; the published error contract is much less so.Key questions
phauthentic/problem-details library alone, with no Symfony bundle, and what is its dependency footprint?symfony/serializer or any PSR-7 implementation, and can that be avoided?type URI registry, or is type free-form per exception class? Free-form means we own the vocabulary from day one.HttpExceptionInterface semantics that Laravel's HttpException does not mirror?Stack fit
withExceptions() in bootstrap/app.php, applied to API routes only.JsonResponse plus a small ProblemDetails value object is sufficient and has zero dependency surface.Migration path
type URI vocabulary and status mapping into our own config/repo, not into package defaults. The vocabulary is the durable artifact; the library is replaceable.message breaks at once.ProblemFactory or equivalent) so the underlying implementation can be swapped without touching call sites. This is cheap here and is the entire mitigant for the adoption risk.Compatibility
0.x or whatever the current tag resolves to) if the base library is consumed directly; with no dependents there is no community signal that a patch bump is safe.Content-Type: application/problem+json assertions to contract tests, plus schema tests on required fields. These survive any library swap.composer why-not against the current lockfile before the spike — a symfony/serializer or PSR-7 collision is the most likely failure and it fails early and cheaply.Sequencing
type URI vocabulary, status mapping, and redaction rules with the API consumer owners. This is the real decision, not the package.Maintenance
type vocabulary and redaction rules; those are application concerns that no package can carry for us.Support
detail field leaking a path or an internal ID.Scaling
Content-Type on 4xx/5xx, which silently breaks client discrimination between problem documents and generic errors.Failure modes
application/json instead of application/problem+json, or missing type on unhandled exceptions. Mitigation: contract tests, not manual review.instance/detail carrying internal identifiers or stack traces. Mitigation: explicit redaction policy plus a test asserting unhandled exceptions return a generic detail.type URIs as public API and review them under the same change control as endpoints.Ramp-up
Content-Type and redaction expectations is sufficient.Recommendation: Proceed on the pattern, decline the bundle. The RFC 9457 contract is worth standardizing across our APIs; this specific package is not the vehicle for it in a Laravel estate, given the vendor mismatch, 1 star, 0 dependents, and no observable support history. Fund a one-day spike on the framework-agnostic core library, approve only if it stays dependency-light, and treat the type vocabulary and redaction rules as the actual deliverable with an internal owner.
How can I help you explore Laravel packages today?