vdomah / octoexcel

OctoberCMS wrapper for Maatwebsite/Laravel-Excel
MIT License
14 stars 10 forks source link

Compatibility with octoberCMS v2 #19

Open Ladylain opened 2 years ago

Ladylain commented 2 years ago

Hi,

i'm using this plugin since a long time, and since few months, i'm upgrading my websites to OctoberCMS v2.0 Today, i had to deploy this plugin to a website, unfortunately, it didn't work well.

My import code is like this :

Excel::excel()->import(new ModelImport, 'file.csv');

and i have this error showing : Declaration of Vdomah\Excel\Classes\XlsxStyled::load(string $pFilename, int $flags = 0) must be compatible with PhpOffice\PhpSpreadsheet\Reader\BaseReader::load(string $filename, int $flags = 0): PhpOffice\PhpSpreadsheet\Spreadsheet

so, to fixed this, i tried to disabled row 25 in Vdomah\Excel\Classes\Excel

//\PhpOffice\PhpSpreadsheet\IOFactory::registerReader('xlsx_styled', XlsxStyled::class);

and all works fine now. Did somebody already had this error ?

thanks Lucas.

markandmedia commented 2 years ago

I encountered the same problem. Thanks Lucas for posting this "solution", disabling that line also fixed the problem for me

chrisvidal commented 2 years ago

same issue here. Is there a way to integrate the fix in the current version instead of manually commenting? What are the implications of commenting this line?