kaninstein / laravel-app-errors
Consistent API error contract (HTTP semantic) with request_id and environment-aware debug payloads for Laravel.
v1.0.1
2025-12-24 10:51 UTC
Requires
- php: ^8.2
- illuminate/http: ^12.0
- illuminate/support: ^12.0
README
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
Install
composer require kaninstein/laravel-app-errors
Usage
Publish config:
php artisan vendor:publish --tag=app-errors-config
Add Kaninstein\LaravelAppErrors\Http\Middleware\RequestIdMiddleware to your API/web middleware stack and render JSON errors using Kaninstein\LaravelAppErrors\Http\ExceptionMapper.