public function excel() { $data = Game::all(); $kategori = Kategori::lists('kategori', 'id'); Excel::create('ExportExcel' . Carbon::now() . '', function ($excel) use($data) { $excel->sheet('coba1', function ($sheet) use($data) { $sheet->fromArray($data); }); })->export('xls'); }