public function getAllRequestsToExcel() { $requests = \App\Request::select('id', 'first_name', 'last_name', 'description', 'created_at')->get(); Excel::create('requests', function ($excel) use($requests) { $excel->sheet('Sheet 1', function ($sheet) use($requests) { $sheet->fromArray($requests); }); })->export('xls'); }