Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,14 @@ For Laravel 5.3

You'll then need to run `composer install` or `composer update` to download it and have the autoloader updated.

Once Laravel-API-Exceptions is installed, you need to register the service provider. Open up `config/app.php` and add the following to the providers key.
Once Laravel-API-Exceptions is installed, if you're using Laravel 5.1, 5.2, 5.3, and 5.4, you need to register the service provider. Open up `config/app.php` and add the following to the providers key.

```php
Lanin\Laravel\ApiExceptions\ApiExceptionsServiceProvider::class,
```

If you're using Laravel 5.5, you don't need to add anything in `config/app.php`. It will use package auto discovery feature in Laravel 5.5.

### Exceptions

Every ApiException can be thrown as a normal exception and they will be automatically serialized to JSON with corresponding HTTP status, if user wants json:
Expand Down
7 changes: 7 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
"Lanin\\Laravel\\ApiExceptions\\Tests\\": "tests/"
}
},
"extra":{
"laravel":{
"providers":[
"Lanin\\Laravel\\ApiExceptions\\ApiExceptionsServiceProvider"
]
}
},
"minimum-stability": "dev",
"prefer-stable": true
}