EdsonOrdaz's avatar

Error when importing excel file

Hello, I am using the Laravel Excel library, but when importing I get an error that I cannot solve. my controller has the following

    public function saveFile()
    {
        $this->validate();
        $this->excel->storeAs('excel.xslx');
        $test=storage_path().'/app/excel.xslx';
        $rows = laravelExcel::import(new GenerateExcel, $test);
        dd($rows);
    }

and my Import the following:

class GenerateExcel implements ToModel, WithCalculatedFormulas, WithHeadingRow, SkipsEmptyRows
{
    public function model(array $rows)
    {
        return $rows;
    }
}

The error it gives me is the following: Imgur

I am using docker to run Laravel and I have already installed the extensions that Laravel Excel requests.

0 likes
1 reply
dhanar98's avatar

Hi @edsonordaz

Based on the exception in your image you need to install database related php extensions pdo_pgsql , pdo_mysql, mysqli. one more thing for the excel related operations install the gd , xml,xmlwriter,xmlreader extensions

Please or to participate in this conversation.