1

AAm using "maatwebsite/excel": "^2.1" to import data from an excel fuile but it fails with an error

"message": "Class 'ZipArchive' not found",

I have

 $data = Excel::load('storage/app/temporary'.'/'.$request->input('file'))->get();

   var_dump($data);

Then am getting an error

 "message": "Class 'ZipArchive' not found",

Where am I going wrong?

I have imported

use Maatwebsite\Excel\Facades\Excel;

I have tried adding

PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);

but now gets an error

PclZip has a deprecated constructor in /home/geowan/Desktop/apps/laravel/importapi/

vendor/phpoffice/phpexcel/Classes/PHPExcel/Shared/PCLZip/pclzip.lib.php on line 190

2

1 Answer 1

2

If you would like to use ZipArchive, you would have to install the PHP zip extension.

You can find more info on how to install it here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.