pedrosalpr/laravel-api-problem
Laravel API Problem brings RFC 7807/9457 problem details to your Laravel API, helping you return consistent, standards-compliant JSON error responses. Document, debug, and consume API errors more easily with structured problem payloads and simple helpers.
application/problem+json, with type/title/status/detail/instance) is the decision point for a roadmap item most teams defer indefinitely: a machine-readable, documented error shape. This package is a low-cost way to close that item on Laravel services.type URIs also give you a namespace for a shared error taxonomy across teams.instance and detail give support and on-call a correlatable reference per failure, which is often the cheapest lever on "customer sent a screenshot, we can't reproduce" tickets.Consider adoption when:
Look elsewhere or defer when:
AuthenticationException sensibly, its test coverage, and compatibility with your Laravel/PHP versions.To executives: Our API returns errors in whatever shape each endpoint happens to produce, which slows partner onboarding, generates integration support tickets, and blocks us from shipping generated client SDKs. RFC 9457 is the industry-standard error format, and this package implements it on Laravel with minimal engineering effort. The cost is small and contained, the change is reversible, and the payoff is a documented, predictable contract that external teams can build against without asking us questions. The main caveat is that it's an early-stage open-source library with limited adoption, so we'd pin the version and keep the integration thin enough to replace.
To engineering: This is a narrow adapter that renders exceptions as application/problem+json per RFC 9457, wired into Laravel's existing exception handling rather than replacing it. Work involved is small: adjust the exception handler, verify validation/auth/404/429 paths, add contract tests asserting the response shape, and decide versioning for the rollout. Keep an internal abstraction at the boundary so we can swap or vendor the package without touching call sites. Risk is dependency maturity, not technical complexity — we should read the source, pin it, and confirm Laravel/PHP version support before merging.
How can I help you explore Laravel packages today?