Releases: HRADigital/php-exceptions-laravel
Releases · HRADigital/php-exceptions-laravel
Release list
1.2.0
Full Changelog: 1.1.2...1.2.0
1.1.2
1.1.1
1.1.0
1.0.0
First public release of hradigital/php-exceptions-laravel.
Laravel wiring + JSON renderer for hradigital/php-exceptions. Translates the upstream
AbstractBaseException tree into a uniform JSON response at the HTTP boundary, only for API requests — browser requests still fall through to
Laravel's default error pages.
Highlights
- 🚀 Auto-discovered service provider — drop the package in, no manual registration needed. Binds
ExceptionRendereras a singleton and hooks
Laravel's exception handler viarenderable(). - 🎯 API-only gating — the renderer activates only when the request looks like an API call (
expectsJson()/wantsJson(),isJson(), path
api/*, or route nameapi.*). HTML / Whoops / Blade error pages are untouched for everything else. - 🧩 Strategy-based renderers — pluggable
ExceptionRendererInterface;add()prepends so later registrations win. Ships with:DefaultRenderer— always-matching fallback, emits{message, code, data?}.InputFailureRenderer— matchesRequestFailureInterface, emits{message, code, rules, failed}with field-keyed rules and a flattened
per-message list.
- ✅ Tested end-to-end — Orchestra Testbench-backed suite covers dispatcher wiring, both bundled renderers, the service provider, and the
API-vs-non-API gating logic.
Compatibility
| PHP | Laravel 10 | Laravel 11 | Laravel 12 |
|---|---|---|---|
| 8.1 | ✅ | ||
| 8.2 | ✅ | ✅ | ✅ |
| 8.3 | ✅ | ✅ | |
| 8.4 | ✅ |
CI runs lint → phpcs → phpstan (level 6) → phpunit across every cell on every push and PR.
Install
composer require hradigital/php-exceptions-laravel
License
GPL-3.0-or-later, matching the upstream hradigital/php-exceptions package.