© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
7 replies
TheNastyPasty

Is it somehow possible to set the select value to null if not visible

I am trying to set the select value to null if the field is not visible in the form. What I have so far.
Toggle::make('customize_compounding')->label('Customize Compounding')->live()->columnSpan(['default' => 2]),
    Group::make([
        Select::make('compound_interval')
            ->enum(CompoundInterval::class)
            ->options(CompoundInterval::class)
            ->default(CompoundInterval::OneMonth->value)
            ->selectablePlaceholder(false)
            ->columnSpan(['default' => 2, 'sm' => 1]),
    ])->visible(fn (\Filament\Forms\Get $get): bool => $get('customize_compounding'))
Toggle::make('customize_compounding')->label('Customize Compounding')->live()->columnSpan(['default' => 2]),
    Group::make([
        Select::make('compound_interval')
            ->enum(CompoundInterval::class)
            ->options(CompoundInterval::class)
            ->default(CompoundInterval::OneMonth->value)
            ->selectablePlaceholder(false)
            ->columnSpan(['default' => 2, 'sm' => 1]),
    ])->visible(fn (\Filament\Forms\Get $get): bool => $get('customize_compounding'))

I don't know how to make that work. Someone has an idea?
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

Is it possible to set default selected value?
FilamentFFilament / ❓┊help
3y ago
Is it somehow possible to access the value of a different field?
FilamentFFilament / ❓┊help
2y ago
formatStateUsing not called if value is null
FilamentFFilament / ❓┊help
3y ago
Disable select by evaluating if another input value is null or not
FilamentFFilament / ❓┊help
2y ago