red-explosion / undefined
API error handling for Laravel.
Requires
- php: ^8.2
- illuminate/support: ^10.0
Requires (Dev)
- laravel/pint: ^1.10
- orchestra/testbench: ^8.0
- pestphp/pest: ^2.6
- pestphp/pest-plugin-arch: ^2.1
- phpstan/phpstan: ^1.10
- red-explosion/pint-config: ^1.1
- spatie/laravel-ray: ^1.32
This package is auto-updated.
Last update: 2024-10-22 05:07:04 UTC
README
Undefined for Laravel takes care of formatting exceptions and errors into nicely formatted JSON responses.
Warning Package is in early stages of development. It means there may be bugs and API is very likely to change. Create an issue if you spot a bug. Ideas are welcome.
Installation
You can install the package via composer:
composer require red-explosion/undefined
You can publish the config file with:
php artisan vendor:publish --tag="undefined-config"
Usage
In order to use Undefined, you need to replace your exception handler. Replace the following in your
bootstrap/app.php
file:
$app->singleton( Illuminate\Contracts\Debug\ExceptionHandler::class, App\Exceptions\Handler::class );
with the following:
$app->singleton( Illuminate\Contracts\Debug\ExceptionHandler::class, RedExplosion\Undefined\ExceptionHandler::class );
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
If you discover a security vulnerability, please send an e-mail to Ben Sherred via ben@redexplosion.co.uk. All security vulnerabilities will be promptly addressed.
Credits
License
The MIT License (MIT). Please see License File for more information.