按照文件中的說明進行excel匯出時,遇到各種錯誤,順手記一下這個錯誤的解決方法
錯誤:laravel excel No ReaderType or WriterType could be detected
正確程式碼:Excel::store($export, $this->fileName, ‘admin’, ‘Xlsx’, []);
private static $readers = [
'Xlsx' => Reader\Xlsx::class,
'Xls' => Reader\Xls::class,
'Xml' => Reader\Xml::class,
'Ods' => Reader\Ods::class,
'Slk' => Reader\Slk::class,
'Gnumeric' => Reader\Gnumeric::class,
'Html' => Reader\Html::class,
'Csv' => Reader\Csv::class,
];
private static $writers = [
'Xls' => Writer\Xls::class,
'Xlsx' => Writer\Xlsx::class,
'Ods' => Writer\Ods::class,
'Csv' => Writer\Csv::class,
'Html' => Writer\Html::class,
'Tcpdf' => Writer\Pdf\Tcpdf::class,
'Dompdf' => Writer\Pdf\Dompdf::class,
'Mpdf' => Writer\Pdf\Mpdf::class,
];
本作品採用《CC 協議》,轉載必須註明作者和本文連結