vdomah / octoexcel

OctoberCMS wrapper for Maatwebsite/Laravel-Excel
MIT License
14 stars 10 forks source link

Export From Template Code Sections #6

Closed shakogele closed 4 years ago

shakogele commented 6 years ago

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'); }


vdomah commented 5 years ago

Hi, missed this issue, sorry. It's hard to tell what's the difference. If it works from component php code, you can move this function there.

vdomah commented 4 years ago

issue is outdated because of plugin migration to v3 of Laravel-Excel