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エクセル::($エクスポートを使用します( 'データのエクスポート'、関数($エクセル)を使用する($エクスポート){ \t \t $ excel->シート( 'シート1'、関数($シート)を作成){ \t \t \t $ sheet-> fromArray($ export); \t \t}); \t}) - > export( 'xlsx'); } – Borna
まだ動作していません。 –
はあなたのモデルのLaravelExcelWriter.phpですか? – Borna