SpartnerNL / Laravel-Excel

🚀 Supercharged Excel exports and imports in Laravel
https://laravel-excel.com
MIT License
12.27k stars 1.92k forks source link

Undefined variable: events even though public function indexsort works #1359

Closed JngWny closed 6 years ago

JngWny commented 7 years ago

Here is my controller SetTwoController .txt

sort function works export function does not filters based on "Eloquent Techniques: Dedicated Query String Filtering"

I can make the export work if i just export whole table

When trying to export that filtered data with Maatweb/Excel

I get these errors when exporting (2/2) ErrorException

Undefined variable: events (View: /var/www/html/graphs/resources/views/traces/sortable.blade.php)

laravel ver 5.4

// complete code @ https://github.com/JngWny/DataGroup

JngWny commented 7 years ago

changing to array did not work public function export(DataFilters $filters) { $events = SetTwo::filter($filters)->paginate(29); Excel::create('Results', function($excel) { $excel->sheet('data',function($sheet) { $sheet->loadView('traces.sortable',array('events'=>$events)); }); })->download('xls'); }

JngWny commented 7 years ago

using array function return all values in excel shreadhseet from export function "$sheet->fromArray($events);" (see entire controller) sort feature still works

my controller SetTwoController .txt

JngWny commented 7 years ago

not closed mistake