/** * Export list of departments to Excel * * @return Excel */ public function export() { $departments = $this->departments->getCSVReport(); $excel = new ExportToExcel($departments, 'List of Departments'); return $excel->export(); }