© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
Salty

[v2] Using reactive/dependent fields sends all fields to be saved

Having the following configuration
Forms\Components\Section::make('Config')
    ->schema([
        Forms\Components\Fieldset::make('config')
            ->relationship('config')
            ->schema([
                Forms\Components\Select::make('driver')
                    ->options(DriverOptions::options()->toArray())
                    ->columnSpanFull()
                    ->reactive(),

                Forms\Components\Repeater::make('credentials')
                    ->schema([
                        Forms\Components\TextInput::make('name'),
                        Forms\Components\TextInput::make('value'),
                    ])
                    ->hidden(function (\Closure $get) {
                        return $get('driver') !== 'option1';
                    }),

                Forms\Components\Repeater::make('credentials')
                    ->schema([
                        Forms\Components\TextInput::make('extra_login'),
                    ])
                    ->hidden(function (\Closure $get) {
                        return $get('driver') !== 'option2';
                    }),
            ])
    ])
Forms\Components\Section::make('Config')
    ->schema([
        Forms\Components\Fieldset::make('config')
            ->relationship('config')
            ->schema([
                Forms\Components\Select::make('driver')
                    ->options(DriverOptions::options()->toArray())
                    ->columnSpanFull()
                    ->reactive(),

                Forms\Components\Repeater::make('credentials')
                    ->schema([
                        Forms\Components\TextInput::make('name'),
                        Forms\Components\TextInput::make('value'),
                    ])
                    ->hidden(function (\Closure $get) {
                        return $get('driver') !== 'option1';
                    }),

                Forms\Components\Repeater::make('credentials')
                    ->schema([
                        Forms\Components\TextInput::make('extra_login'),
                    ])
                    ->hidden(function (\Closure $get) {
                        return $get('driver') !== 'option2';
                    }),
            ])
    ])


when I save the model, having selected
option1
option1
for instance and filling up the values, I get the extra_login field in my JSON attribute in my model

Expected:
- name: Name 1
- value: Value 1

Actual
- name: Name 1
- value: Value 1
- extra_login: null
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

Reactive Fields
FilamentFFilament / ❓┊help
15mo ago
Reactive fields
FilamentFFilament / ❓┊help
3y ago
how to add Select Field data using reactive() in the Text fields just like Dependent fields
FilamentFFilament / ❓┊help
3y ago
Dependent select without parent being saved to the database
FilamentFFilament / ❓┊help
14mo ago