$fileName = $date . '.xls'; $fileContent = Excel::create($fileName , function($excel) use ($licencies) { $excel->sheet('Excel', function($sheet) use ($licencies) { $sheet->fromArray($licencies); }); })->string('xls'); Storage::disk('s3')->put($fileName, $fileContent);