© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•6mo ago•
1 reply
Nedwor

Filament Exporter : How to custom the columns selection modal ?

Hello everyone, I'm trying to custom this magnificent modal from Filament exporter. But I struggle to make it work. Is it even possible ?

I'm trying to do something like this, using getOptionsFormComponents() and putting ->columnMapping(false) on my exporter
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)
    ];
}


But it seems that ->columnMapping(false) completely overtake the column selection ? Because, with this method, I get a beautiful column selection but end up with a full export, meaning every columns are exported.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Filament Exporter
FilamentFFilament / ❓┊help
2y ago
Filament Exporter
FilamentFFilament / ❓┊help
3y ago
Filament Exporter dinamicly add columns to excel from relationship?
FilamentFFilament / ❓┊help
17mo ago
Filament - Custom Modal - Help
FilamentFFilament / ❓┊help
2y ago