как этот код перевести на версию 3? не могу понять
return Excel::download(function($excel) {
$excel->sheet('import', function($sheet) {
$sheet->setStyle(array(
'font' => array(
'name' => 'Calibri',
'size' => 14,
'bold' => false
)
));
$sheet->cell('A1','КЛИЕНТ');
$sheet->cell('B1','ДАТА');
$sheet->cell('C1','ТРАНСПОРТ');
$sheet->cell('D1','FARM');
$sheet->cell('E1','VARIETIE');
$sheet->cell('F1','LENGHT');
$sheet->cell('G1','HB');
$sheet->cell('H1','PACKING');
$sheet->cell('I1','QUANITY');
$sheet->cell('J1','STOP PRICE');
//$sheet->cell('K1','NOTE');
$i = 3;
$purchases = Purshase::all();
foreach ($purchases as $purchase){
$sheet->cell('A'.$i, $purchase->email);
$sheet->cell('A'.$i, function($cell) {
$cell->setAlignment('left');
$cell->setValignment('top');
});
$sheet->cell('B'.$i, function($cell) {
$cell->setAlignment('left');
$cell->setValignment('top');
});
$sheet->cell('C'.$i, function($cell) {
$cell->setAlignment('left');
$cell->setValignment('top');
});
$sheet->cell('K'.$i, function($cell) {
$cell->setAlignment('left');
$cell->setValignment('top');
});
$sheet->setSize('A'.$i, 15,20);
$sheet->setSize('B'.$i, 15,20);
$sheet->setSize('C'.$i, 15,20);
//$sheet->setSize('K'.$i, 20,20);
$sheet->cell('B'.$i, $purchase->datep);
$sheet->cell('C'.$i, $purchase->transport);
$purchaseUsers = PurshaseUser::where('purchase_id', $purchase->id)->get();
$countMerge = $i + $purchaseUsers->count();
$sheet->mergeCells('A'.$i.':A'.$countMerge);
$sheet->mergeCells('B'.$i.':B'.$countMerge);
$sheet->mergeCells('C'.$i.':C'.$countMerge);
//$sheet->mergeCells('K'.$i.':K'.$countMerge);
$sheet->mergeCells('A'.($countMerge+1).':K'.($countMerge+1));
$sheet->cell('A'.($countMerge+1), $purchase->message);
foreach ($purchaseUsers as $purchaseUser){
$sheet->cell('D'.$i, $purchaseUser->farm);
$sheet->cell('E'.$i, $purchaseUser->sort);
$sheet->cell('F'.$i, $purchaseUser->length);
$sheet->cell('G'.$i, $purchaseUser->countc);
$sheet->cell('H'.$i, $purchaseUser->uppach);
$sheet->cell('I'.$i, $purchaseUser->count);
$sheet->cell('J'.$i, $purchaseUser->maxprice);
$i = $i + 1;
}
$i = $i + 3;
}
//$sheet->mergeCells('A2:A5');
});
},'import.xlsx');