© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
11 replies
Suky

Dinamically update options based on another input

so the question is pretty straight forward, is there a way to update the options of a select field based on another field?

so these options would be nice if I could add an where query
Forms\Components\Select::make('bundle_descriptor_id')
                            ->label('Bundle Descriptor')
                            ->searchable()
                            ->relationship('descriptor', 'name')
                            ->createOptionForm([
                                Forms\Components\TextInput::make('name')
                                    ->required(),
                            ])
                            ->options(function () {
                                return \App\Models\StreamingBundleDescriptor::all()->pluck('name', 'id')->toArray();
                            })
                            ->required(),
Forms\Components\Select::make('bundle_descriptor_id')
                            ->label('Bundle Descriptor')
                            ->searchable()
                            ->relationship('descriptor', 'name')
                            ->createOptionForm([
                                Forms\Components\TextInput::make('name')
                                    ->required(),
                            ])
                            ->options(function () {
                                return \App\Models\StreamingBundleDescriptor::all()->pluck('name', 'id')->toArray();
                            })
                            ->required(),

based on this input
 Forms\Components\Select::make('streaming_bundle_id')
                    ->label('Streaming Bundle')
                    ->searchable()
                    ->options(function () {
                        return \App\Models\StreamingBundle::all()->pluck('name', 'id')->toArray();
                    })
                    ->required(),
 Forms\Components\Select::make('streaming_bundle_id')
                    ->label('Streaming Bundle')
                    ->searchable()
                    ->options(function () {
                        return \App\Models\StreamingBundle::all()->pluck('name', 'id')->toArray();
                    })
                    ->required(),
Solution
You need to use
->live()
->live()
in such a case. Take a look in the docs to figure all related methods like
->afterStateUpdated()
->afterStateUpdated()

https://filamentphp.com/docs/3.x/forms/advanced
Advanced forms - Form Builder - Filament
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

text input field update based on another text input
FilamentFFilament / ❓┊help
2y ago
how to change selectfilter options based on another selectfilter?
FilamentFFilament / ❓┊help
3mo ago
Show a list of options based on another field
FilamentFFilament / ❓┊help
2y ago
Repeater based on user input
FilamentFFilament / ❓┊help
3y ago