documents = $documents; $this->title = $title; $this->from = $from; $this->to = $to; } /** * @return \Illuminate\Support\Collection */ public function collection() { return $this->documents; } abstract public function headings(): array; abstract public function map($document): array; public function title(): string { return $this->title; } public function startCell(): string { return 'A1'; } public function columnFormats(): array { return [ 'A' => NumberFormat::FORMAT_DATE_DDMMYYYY, ]; } public function registerEvents(): array { return [ AfterSheet::class => [self::class, 'afterSheet'], ]; } public static function afterSheet(AfterSheet $event) { // $event->getSheet()->getDelegate()->setCellValue('A10', 'xxx'); // $style = new Color(Color::COLOR_RED);! // $event->getSheet()->getDelegate()->setConditionalStyles('A10', $style);! } }