request->only('startDate', 'endDate'))->get(); return view('excel.mutation-report', compact('mutations')); } public function styles(Worksheet $sheet) { $lastRow = $sheet->getHighestDataRow(); $lastSecondRow = $lastRow - 1; $lastThirdRow = $lastSecondRow - 1; $lastFourRow = $lastThirdRow - 1; return [ 1 => [ 'font' => ['bold' => true, 'size' => 12], 'alignment' => ['vertical' => 'center', 'horizontal' => 'center'], ], 2 => [ 'font' => ['bold' => true, 'size' => 12], 'alignment' => ['vertical' => 'center', 'horizontal' => 'center'], ], 4 => [ 'font' => ['bold' => true], ], $lastRow => [ 'font' => ['bold' => true, 'size' => 12], 'alignment' => ['horizontal' => 'left'], ], $lastSecondRow => [ 'font' => ['bold' => true, 'size' => 12], 'alignment' => ['horizontal' => 'left'], ], $lastThirdRow => [ 'font' => ['bold' => true, 'size' => 12], 'alignment' => ['horizontal' => 'left'], ], $lastFourRow => [ 'font' => ['bold' => true, 'size' => 12], 'alignment' => ['horizontal' => 'left'], ], ]; } }