api-skeletons/laravel-api-problem
Laravel API Problem provides RFC 7807-compliant problem details responses for JSON APIs, helping you return consistent, machine-readable errors with exception and validation support. It integrates with Laravel to standardize API error payloads and status codes.
application/problem+json payloads, so every service in the Laravel estate can emit one predictable error shape instead of ad-hoc {message, errors, code} variants. This is a contract decision, not an implementation detail — it affects SDKs, public docs, partner integrations, and support runbooks.application/problem+json, type/instance/status mapping, and validation-error flattening — roughly a few hundred lines plus ongoing Laravel upgrade upkeep. Adopting the package converts that into a config file and a dependency review.type URIs give support and on-call a stable key to grep, alert on, and link to documentation — a measurable reduction in triage time versus free-text messages.Consider adopting when:
Look elsewhere or build in-house when:
{message, errors} convention plus a lint rule gets you most of the benefit without a dependency.On 2.0.1 specifically: this is a dependency-only patch — it moves instantiator to 2.0 and nothing else. Treat it as routine hygiene, not a capability change. Two things to confirm before bumping: (1) instantiator 2.0 raises the PHP floor, so re-check it against your oldest supported runtime; (2) nothing in 2.0.0's API changed, so no application code or config migration is implied. If you are not already on 2.0.x, note that the 1.x → 2.0 jump is where the real review effort sits, not here. Pin the version and let your normal dependency-update cadence absorb it.
To executives: Our APIs currently describe failures differently depending on which endpoint you call. External consumers have to special-case our errors, which shows up as integration support load and slows partner onboarding. This package moves us onto the industry-standard error format (RFC 7807) used across the wider API ecosystem, at the cost of a config file and an exception mapping exercise rather than a custom build. It makes our error surface documentable and contract-testable, and it is the cheaper half of "should we standardize our API responses" — the success path can follow later using the same pattern.
To engineering: It's a small, focused Laravel package that hooks into the exception handler and emits application/problem+json with type, title, status, detail, and instance, plus extensible custom members. Adoption is mostly mapping our existing domain exceptions to problem types and deciding the type URI namespace — that namespace is the durable decision, so get it right the first time. The 2.0.1 release is a dependency bump only, no code changes; the one thing to check is the raised PHP floor from instantiator 2.0 against our supported runtime matrix. Risk is vendor size, not complexity: it's a single-maintainer package, but the surface is small and forkable, so we can pin it and keep a vendored escape hatch. Recommend a spike on one service, ship behind the existing error contract, and expand if triage and partner feedback support it.
How can I help you explore Laravel packages today?