//What i need is something like this:
$record = null //do not know how to access here
$authorColumns = [];
$i = 1;
foreach($record->authors as $author){
$authorColumns[] = ExportColumn::make('Author'.$i)
->formatStateUsing(function($author){
//do work here
});
$i++;
}
return array_merge($columns, $authorColumns);
//What i need is something like this:
$record = null //do not know how to access here
$authorColumns = [];
$i = 1;
foreach($record->authors as $author){
$authorColumns[] = ExportColumn::make('Author'.$i)
->formatStateUsing(function($author){
//do work here
});
$i++;
}
return array_merge($columns, $authorColumns);