Hello,
When I try to export from CMS templates code section it is not downloading a file, it just returns raw data. What I am doing wrong?
Here is my code:
use Vdomah\Excel\Classes\Excel;
use Acme\Test\Models\User;
function onExportExcel(){
Excel::excel()->create('users', function($excel) {
$excel->sheet('Sheet', function($sheet) {
$model = User::get();
$sheet->fromModel($model);
});
})->download('csv');
}
Hello, When I try to export from CMS templates code section it is not downloading a file, it just returns raw data. What I am doing wrong? Here is my code:
use Vdomah\Excel\Classes\Excel; use Acme\Test\Models\User; function onExportExcel(){ Excel::excel()->create('users', function($excel) { $excel->sheet('Sheet', function($sheet) { $model = User::get(); $sheet->fromModel($model); }); })->download('csv'); }