['font' => ['bold' => true]], ]; } }, new class implements FromCollection, WithHeadings, WithTitle, WithStyles { public function collection() { return collect([ ['商品代碼', '必填', '請填寫系統中已存在的商品代號'], ['數量', '必填', '必須為大於 0 的數字'], ['批號', '選填', '若不填寫將自動對應「NO-BATCH」庫存'], ['貨道/儲位', '選填', '主要用於目的倉庫為「販賣機」時指定貨道'], ['備註', '選填', '可填寫該筆明細的備註說明'], ['', '', ''], ['提示', '附加模式', '匯入的明細將附加至現有單據,不會覆蓋原有資料'], ]); } public function headings(): array { return ['欄位名稱', '必要性', '說明']; } public function title(): string { return '匯入規則說明'; } public function styles(Worksheet $sheet) { $sheet->getColumnDimension('A')->setWidth(15); $sheet->getColumnDimension('B')->setWidth(15); $sheet->getColumnDimension('C')->setWidth(50); return [ 1 => ['font' => ['bold' => true]], ]; } }, ]; } }