A laravel package for structing API exception response in JSON followed http://jsonapi.org/.
Via Composer
$ composer require laravel-soft/jer
Once this has finished, you will need to add the service provider to the providers array in your config/app.php
as follows:
'providers' => [
// ...
LaravelSoft\JER\JERServiceProvider::class,
]
Then, publish the localization by running:
php artisan vendor:publish
In the app\Exceptions\Handler.php
, let the class extends LaravelSoft\JER\ExceptionHandler
.
use LaravelSoft\JER\ExceptionHandler;
class Handler extends ExceptionHandler
{
// ...
}
The MIT License (MIT).