Skip to content

Commit f8d99ef

Browse files
Stéphane CoinonWebklex
authored andcommitted
Enable package discovery (#81)
1 parent 8d112c7 commit f8d99ef

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,20 @@ You might also want to check `phpinfo()` if the extension is enabled.
4545
composer require webklex/laravel-imap
4646
```
4747

48-
3) Open your `config/app.php` file and add the following to the `providers` array:
48+
3) If you're running Laravel >= 5.5, package discovery will configure the service provider and `Client` alias out of the box.
4949

50-
``` php
51-
Webklex\IMAP\Providers\LaravelServiceProvider::class,
52-
```
53-
54-
4) In the same `config/app.php` file add the following to the `aliases ` array:
50+
Otherwise, for Laravel <= 5.4, edit your `config/app.php` file and:
5551

56-
``` php
57-
'Client' => Webklex\IMAP\Facades\Client::class,
58-
```
52+
- add the following to the `providers` array:
53+
``` php
54+
Webklex\IMAP\Providers\LaravelServiceProvider::class,
55+
```
56+
- add the following to the `aliases` array:
57+
``` php
58+
'Client' => Webklex\IMAP\Facades\Client::class,
59+
```
5960

60-
5) Run the command below to publish the package config file [config/imap.php](src/config/imap.php):
61+
4) Run the command below to publish the package config file [config/imap.php](src/config/imap.php):
6162

6263
``` shell
6364
php artisan vendor:publish --provider="Webklex\IMAP\Providers\LaravelServiceProvider"

composer.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@
3333
"extra": {
3434
"branch-alias": {
3535
"dev-master": "1.0-dev"
36+
},
37+
"laravel": {
38+
"providers": [
39+
"Webklex\\IMAP\\Providers\\LaravelServiceProvider"
40+
],
41+
"aliases": {
42+
"Client": "Webklex\\IMAP\\Facades\\Client"
43+
}
3644
}
3745
},
3846
"minimum-stability": "dev",

0 commit comments

Comments
 (0)