Skip to content

Commit 4250ba6

Browse files
authored
Merge pull request #4 from matriphe/add-laravel-55-support
Add package auto discovery feature in Laravel 5.5
2 parents 4041d04 + 7ec441d commit 4250ba6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ For Laravel 5.3
3030

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

33-
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.
33+
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.
3434

3535
```php
3636
Lanin\Laravel\ApiExceptions\ApiExceptionsServiceProvider::class,
3737
```
3838

39+
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.
40+
3941
### Exceptions
4042

4143
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:

composer.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929
"Lanin\\Laravel\\ApiExceptions\\Tests\\": "tests/"
3030
}
3131
},
32+
"extra":{
33+
"laravel":{
34+
"providers":[
35+
"Lanin\\Laravel\\ApiExceptions\\ApiExceptionsServiceProvider"
36+
]
37+
}
38+
},
3239
"minimum-stability": "dev",
3340
"prefer-stable": true
3441
}

0 commit comments

Comments
 (0)