public static function getOptionsFormComponents(): array
{
// Get all columns for the export
$columns = self::getColumns();
$columnOptions = collect($columns)->mapWithKeys(function (ExportColumn $column) {
return [$column->getName() => $column->getLabel()];
})->toArray();
return [
Forms\Components\Section::make('Export Options')
->schema([
TextInput::make('file_name')
->label('File name')
->default('beneficiaries_export')
->required()
->maxLength(255)
->columnSpanFull(),
Forms\Components\CheckboxList::make('columns')
->label('Select columns to export')
->options($columnOptions)
->columns(3)
->gridDirection('row')
->bulkToggleable()
->default(array_keys($columnOptions))
])
->columns(1)
];
}
public static function getOptionsFormComponents(): array
{
// Get all columns for the export
$columns = self::getColumns();
$columnOptions = collect($columns)->mapWithKeys(function (ExportColumn $column) {
return [$column->getName() => $column->getLabel()];
})->toArray();
return [
Forms\Components\Section::make('Export Options')
->schema([
TextInput::make('file_name')
->label('File name')
->default('beneficiaries_export')
->required()
->maxLength(255)
->columnSpanFull(),
Forms\Components\CheckboxList::make('columns')
->label('Select columns to export')
->options($columnOptions)
->columns(3)
->gridDirection('row')
->bulkToggleable()
->default(array_keys($columnOptions))
])
->columns(1)
];
}