I use Laravel Excel library and I have tried this code:
public function registerEvents(): array
{
return [
AfterSheet::class => function(AfterSheet $event) {
$styleArray = array('fill' => array(
'color' => array('rgb' => '000000')
));
$cellRange = 'A1:W1'; // All headers
$event->sheet->getDelegate()->getStyle($cellRange)->applyFromArray($styleArray);
},
];
}
As result I get headers without black background color.
Also I tried this array settings:
$styleArray = [
'font' => [
'bold' => true,
],
'background' => [
'color'=> '#000000'
]
];
I use events, not creating. Please don't recommend not relevant answers