red-explosion/undefined

API error handling for Laravel.

v0.2.0 2023-08-04 06:24 UTC

This package is auto-updated.

Last update: 2024-10-22 05:07:04 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

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.