0
我的代码是从网站上复制的。Laravel Excel无法下载和导出
Excel::create('Filename', function($excel) {
// Set the title
$excel->setTitle('Our new awesome title');
// Chain the setters
$excel->setCreator('Maatwebsite')
->setCompany('Maatwebsite');
// Call them separately
$excel->setDescription('A demonstration to change the file properties');
})->download('xls');
我成功下载了一次。
但是,其他的尝试是错误的。
错误消息是。
Whoops, looks like something went wrong.
FatalErrorException in LaravelExcelWriter.php line 263:
Call to a member function getMergeCells() on a non-object
in LaravelExcelWriter.php line 263
出口ü可以使用该公共功能getExport() { \t $ export = Customer :: all(); \t Excel中::创建( '导出数据',函数($ Excel文件)使用($出口){ \t \t $ excel->片( '表1',函数($片)使用($出口){ \t \t \t $ sheet-> fromArray($ export); \t \t}); \t}) - > export('xlsx'); } – Borna
它仍然没有工作。 –
是LaravelExcelWriter.php你的模型? – Borna