Looking to hire Laravel developers? Try LaraJobs

laravel-app-errors maintained by kaninstein

Description
Consistent API error contract (HTTP semantic) with request_id and environment-aware debug payloads for Laravel.
Last update
2025/12/24 11:51 (dev-main)
License
Links
Downloads
6

Comments
comments powered by Disqus

kaninstein/laravel-app-errors

Latest Version on Packagist Total Downloads License

Consistent JSON error contract for Laravel APIs with:

  • Semantic HTTP statuses (422/401/403/404/409/412/503/500)
  • request_id propagation via middleware (X-Request-Id)
  • Environment-aware debug payloads

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.