Consistent JSON error contract for Laravel APIs with:
- Semantic HTTP statuses (422/401/403/404/409/412/503/500)
request_idpropagation via middleware (X-Request-Id)- Environment-aware
debugpayloads
composer require kaninstein/laravel-app-errorsPublish config:
php artisan vendor:publish --tag=app-errors-configAdd Kaninstein\LaravelAppErrors\Http\Middleware\RequestIdMiddleware to your API/web middleware stack and render JSON errors using Kaninstein\LaravelAppErrors\Http\ExceptionMapper.