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
2
Answers
it seems that the file is missing some property, what i did and that worked is i have the file with libreOffliceCal and i did a ctrl + s to save and when i tried again i no longer had this mistake
Find the line of the error at the library file, in my case was some array that should not be null $attributes[$t] I’ve change it.
the error dissapeared.