Level 51
Everything you need to know about exporting a collection is in the documentation: https://docs.laravel-excel.com/3.1/exports/collection.html.
Perhaps read it?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i have this code to export an excel file that has a sheet named "hello" and has a value on A1 "Hello"
return Excel::download(function($excel) {
//create a sheet with hello on A1
$excel->sheet('hello', function($sheet){
$sheet->setCellValue('A1', 'Hello');
});
}, 'Custom Excel.xlsx');
but what i got is a blank excel file, is there anything that i do wrong?
Please or to participate in this conversation.