i want to read xlsx file and write back some data to the file like below :
try {
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xlsx();
$spreadsheet = $reader->load('CatagoryEng.xlsx');
dd($spreadsheet);
} catch (\Exception $ex) {
dd($ex);
}
the above code works fine in local but in server it gives the below exception
ErrorException {#1444 ▼
#message: "Trying to access array offset on value of type null"
#code: 0
#file: "/home/ar../vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Reader/Xlsx/Styles.php"
#line: 133
#severity: E_NOTICE
trace: {▶}
}
other information :
- the some package
"phpoffice/phpspreadsheet": "^1.4"
used both in local and server. - php version is
"php": "^7.1.3"
- laravel version is
"laravel/framework": "5.6.*"