diff --git a/src/Importable.php b/src/Importable.php index fab9511..ae5612d 100644 --- a/src/Importable.php +++ b/src/Importable.php @@ -4,6 +4,7 @@ use Illuminate\Support\Collection; use Illuminate\Support\Str; +use OpenSpout\Common\Entity\Cell; use OpenSpout\Reader\SheetInterface; use OpenSpout\Writer\Common\AbstractOptions; @@ -148,7 +149,13 @@ private function importSheet(SheetInterface $sheet, callable $callback = null) $count_header = 0; foreach ($sheet->getRowIterator() as $k => $rowAsObject) { - $row = $rowAsObject->toArray(); + $row = array_map(function (Cell $cell) { + return match (true) { + $cell instanceof Cell\FormulaCell => $cell->getComputedValue(), + default => $cell->getValue(), + }; + }, $rowAsObject->getCells()); + if ($k >= $this->start_row) { if ($this->with_header) { if ($k == $this->start_row) {