I need to put the first column is the number of row and the 1st and 2nd row I need to put the title of excel (not the data, it looks like the header of page). What should I do for this case? I've tried using map($row, $index)
to get number index+1 but it not supported for laravel-excel. Here is it my current code
public function map($row): array
{
$fields = [
//i need in this column should give number 1,2,3,...
Date::dateTimeToExcel($row->date),
$row->title,
$row->link,
$row->file,
$row->description,
];
return $fields;
}
public function headings(): array
{
$fields = [
'Date',
'Title',
'Link',
'Evidence',
'Desc',
];
return $fields;
}