Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined class constant 'XLSX' in 2.1 version #1611

Closed
zong0828 opened this issue Apr 10, 2018 · 9 comments
Closed

Undefined class constant 'XLSX' in 2.1 version #1611

zong0828 opened this issue Apr 10, 2018 · 9 comments
Labels

Comments

@zong0828
Copy link

I am first time to use Maatwebsite/Laravel-Excel.

When i download the 2.1 version, cmd will show

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

In excel.php line 59:

  Undefined class constant 'XLSX'


Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

I have no idea what happened.
If i download 2.0~2.9 , cmd will show installation failed.

@patrickbrouwers
Copy link
Member

If it's the first time installing Laravel-Excel it's interesting that you already have a config/excel.php file. And looking at the error message it seems you have the 3.0 config file while trying to install the 2.1 version.

@zong0828
Copy link
Author

@patrickbrouwers Yes, sir . Actually, i download the Maatwebsite/Laravel-Excel 3.0 at the first time, but it show some error message in the controller.(cmd is good and download successfully) Then, i trying to google this message, and some people said the version 3.0 doesn't support import function... Therefore, i am trying to download the 2.0~2.1 version.

@patrickbrouwers
Copy link
Member

You have to delete the config/excel.php before downgrading

@zong0828
Copy link
Author

@patrickbrouwers it work!!!!!!!!!!!!!!!! Thanks a lot for your help

@patrickbrouwers
Copy link
Member

You're welcome

@aineelz
Copy link

aineelz commented Apr 20, 2018

so we need to delete config/excel.php first then we can use 2.1 version?

@MrCherevko
Copy link

@aineelz You need to delete config/excel.php, and then run:
If you using laravel 4:

php artisan config:publish maatwebsite/excel

Else you are using laravel 5:

php artisan vendor:publish --provider="Maatwebsite\Excel\ExcelServiceProvider"

@aineelz
Copy link

aineelz commented Aug 3, 2018

@MrCherevko Tq

@maulik41
Copy link

patrickbrouwers your suggestion "You have to delete the config/excel.php before downgrading" works for me thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants