With the following code, I am able to read the cells out of an Excel file with PHPExcel.
I currently manually define how many rows and columns to re
$spreadsheet = new Spreadsheet();
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('xls');
$reader->setReadDataOnly(true);
$spreadsheet = $reader->load('file location here');
$worksheet = $spreadsheet->getActiveSheet();
foreach ($worksheet->getRowIterator() AS $row) {
$cellIterator = $row->getCellIterator();
$cellIterator->setIterateOnlyExistingCells(FALSE); // This loops through all cells,
$cells = [];
foreach ($cellIterator as $cell) {
$cells[] = $cell->getValue();
}
$rows[] = $cells;
}
//blade html
@foreach($rows[0] as $heading)
{{$heading}}
@endforeach
@foreach($rows as $key=>$val)
@if(!($key == 0))
@foreach($val as $value)
{{$value}}
@endforeach
@endif
@endforeach
```