- Which Laravel and PHP versions does kamranahmedse/laravel-faulty actually support?
- The only published release is from February 2017, which predates Laravel 5.5 package auto-discovery, the Laravel 8 exception handler refactor, and PHP 8 typed signatures. Its Composer constraints almost certainly exclude Laravel 9+, 10, 11, 12 and PHP 8.x, so installation will likely fail or require constraint overrides. Constraint overrides are a smell for production dependencies, so verify resolution on your exact target stack before committing.
- Can I just composer require kamranahmedse/laravel-faulty on Laravel 10, 11 or 12?
- Realistically no. The package artifact is a 2017-era dependency and its constraints will not resolve cleanly on a modern stack without overrides. The recommended integration mode is vendor-and-own: read the handful of classes, then reimplement the behaviour natively in your App\Exceptions\Handler using renderable closures and shouldRenderJsonWhen. That takes well under a sprint and removes the dependency risk entirely.
- Does laravel-faulty replace my App\Exceptions\Handler, and will my report() logic and Sentry/Flare hooks survive?
- Faulty is a thin formatting layer over Laravel's HTTP exception pipeline rather than a full replacement of request handling, routing or business logic. In principle rendering and reporting are separate concerns, so report() and your Sentry/Flare integrations should keep firing, but this must be verified rather than assumed. Check that custom logging, alerting and reporting hooks still run after the render path is customized.
- How does it handle framework-native exceptions like ValidationException, AuthenticationException, ModelNotFoundException and ThrottleRequestsException?
- These are exactly the edge cases flagged as a moderate risk because a low-scrutiny package may handle them inconsistently or not at all. Validation 422s, auth 401s, model-not-found 404s and rate-limit 429s each need the correct status code and a sensible problem+json body. Test each one explicitly, or map exception types to status codes yourself in a native implementation.
- Is APP_DEBUG respected, or can stack traces, SQL and file paths leak into production responses?
- Exception-to-JSON renderers historically leak stack traces, SQL and internal class names when debug handling is not explicitly gated. Treat this as a moderate information-disclosure risk and verify the behaviour rather than assuming it. In any fork or reimplementation, gate type, title, status, detail and instance so that only safe detail reaches production responses.
- Will laravel-faulty return JSON to HTML clients, or does it do content negotiation?
- The package's purpose is to force exceptions into application/problem+json bodies, which is ideal for API-only services where every consumer is a JSON client. It is a poor fit for mixed full-stack apps serving HTML, because forcing problem+json on browser requests degrades user-facing error pages. Scope it to API routes, or use expectsJson and shouldRenderJsonWhen so HTML clients keep their normal error views.
- Can I customise the type URIs to point at my own error documentation, and are extension members supported?
- The envelope follows the IETF API problem specification with type, title, status, detail and instance, and the spec permits extension members alongside those fields. Because you will most likely fork or reimplement, you control the type URIs and can point them at your own error docs. If you hand-roll the envelope, validate it against the current RFC 9457 wording and your consumers' expectations, since RFC 7807 to 9457 is backward compatible but not identical in emphasis.
- What are the alternatives to laravel-faulty in modern Laravel?
- Modern Laravel ships native equivalents: renderable closures on exceptions, shouldRenderJsonWhen and expectsJson on the handler. These cover the same narrow problem without an unmaintained dependency, and there are also actively maintained error-format packages if you want more envelope features. For most teams the native handler is the fastest and safest path.
- Is kamranahmedse/laravel-faulty still maintained and safe to use in production?
- Abandonment risk is high: the last release was 2017, the repository has around 64 stars and shows no visible maintenance, so upstream security or compatibility patches should be assumed never to arrive. The blast radius is contained because the codebase is tiny and easy to read or fork, but stewardship cost is non-trivial. It is fair to treat it as a specification-by-example reference rather than an installable dependency.
- What licence is laravel-faulty under, and how should I test a fork in my app?
- It is MIT licensed, which is permissive and low friction for forking, vendoring and internal reuse provided you keep the attribution notice. If you fork, add feature tests asserting problem+json bodies and correct status codes for validation, authentication, model-not-found and rate-limit cases. Also cover a debug-on versus debug-off run to prove no stack traces or SQL reach production responses.