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