Version:
composer.json :
"require": {
"php": "^8.0.1",
"ext-zip": "*",
"laravel/framework": "^8.25",
"laravel/tinker": "^2.6",
"laravel/ui": "^3.2",
"phpoffice/phpspreadsheet": "^1.16"
Problem:
ErrorException Trying to access array offset on value of type null
After upgrading to Laravel 8 and PHP 8. I'm getting above error.
<?php
use PHPExcel_Reader_Excel2007;
$objReader = new PHPExcel_Reader_Excel2007();
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load('/path/to/filename.xlsx'); // This line
phpspreadsheetinstead ofPHPExcelhere.Can I do something in phpspreadsheet... I don't know. Your example simply opens a file. I've no idea what you're going to want to do after that. Try it and see if it meets your needs.