From 04a34629dd2e46a0f6c7e1c0f5331f00839b67a5 Mon Sep 17 00:00:00 2001 From: Muhammad Zamroni Date: Fri, 6 Oct 2017 12:55:36 +0700 Subject: [PATCH 1/2] Add package auto discovery feature support for Laravel 5.5 --- README.md | 24 ++++++++++++++++++++++-- composer.json | 7 +++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1c46670..d5c0db2 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,29 @@ Use composer to download the package: composer require cyber-duck/laravel-excel ``` -Register the service provider in `config/app.php` adding *Cyberduck\LaravelExcel\ExcelServiceProvider* to the provider array. +### Laravel 4.x -Note. If you are on Laravel 4, use *Cyberduck\LaravelExcel\ExcelLegacyServiceProvider* +Register the service provider in `app/config/app.php` by adding this line to providers array. + +```php +'providers' => [ + 'Cyberduck\LaravelExcel\ExcelLegacyServiceProvider', +], +``` + +### Laravel < 5.5 + +Register the service provider in `config/app.php` by adding this line to providers array. + +```php +'providers' => [ + 'Cyberduck\LaravelExcel\ExcelServiceProvider', +], +``` + +### Laravel 5.5 + +No need to register anything, since it used package auto discovery feature in Laravel 5.5. ## Export Excel diff --git a/composer.json b/composer.json index e258ae0..7f416b8 100644 --- a/composer.json +++ b/composer.json @@ -36,5 +36,12 @@ "tests/utils/FirstColumnOnlySerialiser.php" ] }, + "extra": { + "laravel": { + "providers": [ + "Cyberduck\\LaravelExcel\\ExcelServiceProvider" + ] + } + }, "minimum-stability": "stable" } From c059429c4577f61f6f5019516241d757311d0f17 Mon Sep 17 00:00:00 2001 From: Simone Todaro Date: Fri, 31 Aug 2018 20:50:15 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d5c0db2..a8fea18 100644 --- a/README.md +++ b/README.md @@ -23,11 +23,11 @@ composer require cyber-duck/laravel-excel ### Laravel 4.x -Register the service provider in `app/config/app.php` by adding this line to providers array. +Register the service provider in `config/app.php` by adding this line to providers array. ```php 'providers' => [ - 'Cyberduck\LaravelExcel\ExcelLegacyServiceProvider', + Cyberduck\LaravelExcel\ExcelLegacyServiceProvider::class, ], ``` @@ -37,7 +37,7 @@ Register the service provider in `config/app.php` by adding this line to provide ```php 'providers' => [ - 'Cyberduck\LaravelExcel\ExcelServiceProvider', + Cyberduck\LaravelExcel\ExcelServiceProvider::class, ], ```