Closed shopapps closed 11 months ago
Added ability to format the column data before exporting CSV.
new method ->formatColumns() on the FilamentExportHeaderAction
->formatColumns()
can be passed any array of column names or mix of column names and closures.
if just a column name is passed the raw value is exported.
FilamentExportHeaderAction::make('export')->label(__('Export')) ->formatColumns([ 'status', // will just return raw value 'numbers' => fn(Customer $record): string => $record->numbers()->where('status', Number::STATUS_ACTIVE)->count() . ' / ' . $record->numbers()->where('status', Number::STATUS_DISABLED)->count(), ])
Fixes https://github.com/alperenersoy/filament-export/issues/113
Added ability to format the column data before exporting CSV.
new method
->formatColumns()
on the FilamentExportHeaderActioncan be passed any array of column names or mix of column names and closures.
if just a column name is passed the raw value is exported.
Example usage