kamranahmedse/laravel-faulty
Laravel Faulty wraps fragile code in a fault-tolerant helper so exceptions don't break your app. Define fallbacks, like cached values, defaults, or closures, and Faulty returns them when the wrapped call fails, keeping API or service outages from taking down your requests.
Architecture fit
application/problem+json bodies conforming to the IETF "API problem" specification (RFC 7807, now superseded by RFC 9457).App\Exceptions\Handler). Modern Laravel ships native equivalents (renderable closures, shouldRenderJsonWhen, expectsJson), so the pattern is still valid even where the package is not installable.Integration feasibility
composer require. The published release is February 2017, predating Laravel 5.5 package auto-discovery, Laravel 8's handler refactor, PHP 8 typed signatures, and current Composer constraint enforcement.type/title/status/detail/instance, and register it via renderable/shouldRenderJsonWhen in the existing handler.Technical risk
APP_DEBUG handling is not explicitly gated. This must be verified, not assumed.Key questions
Handler? Will our custom report() logic, Sentry/Flare hooks, and logging survive?ValidationException, AuthenticationException, ModelNotFoundException, ThrottleRequestsException — and are their status codes correct?APP_DEBUG respected, and can we guarantee no stack traces, SQL, or file paths reach production responses?type URIs be customized to point at our own error documentation, and are extension members supported?Stack fit
Migration path
App\Exceptions\Handler using renderable/shouldRenderJsonWhen, plus a small ProblemDetails value object and a config-driven type-URI map.Compatibility
renderable, expectsJson, and handler lifecycle, eliminating the upgrade cliff.Sequencing
type URIs before code./api/*; keep existing error shapes for legacy routes.Content-Type: application/problem+json, required members, and absence of internal detail on 5xx.Maintenance
Support
Scaling
Failure modes
APP_DEBUG=false.report(), errors stop reaching Sentry/Flare. Verify reporting is preserved.Ramp-up
How can I help you explore Laravel packages today?