© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
Mambi

TagsInput : Suggestions list

Hi, is there a way to reset the suggestions list of TagsInput field ?
i've a case when changing a select field i should change the the suggestions list
here's my code :
                        Select::make('model')
                            ->options(['model1' => 'model1', 'model2' => 'model2'])
                            ->afterStateUpdated(fn ($set) => $set('ids', []))
                            ->reactive()
                            ->required(),
Forms\Components\TagsInput::make('ids')
                            ->suggestions(
                                function ($state, $get) {
                                    if ($get('model')) {
                                        return app()->make("App\Models\\" . $get('model'))::pluck('name', 'id');
                                    } else
                                        return $state;
                                }
                            )
                            ->required(),
                        Select::make('model')
                            ->options(['model1' => 'model1', 'model2' => 'model2'])
                            ->afterStateUpdated(fn ($set) => $set('ids', []))
                            ->reactive()
                            ->required(),
Forms\Components\TagsInput::make('ids')
                            ->suggestions(
                                function ($state, $get) {
                                    if ($get('model')) {
                                        return app()->make("App\Models\\" . $get('model'))::pluck('name', 'id');
                                    } else
                                        return $state;
                                }
                            )
                            ->required(),
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

TagsInput belongsToMany
FilamentFFilament / ❓┊help
2y ago
TagsInput Validation
FilamentFFilament / ❓┊help
3y ago
TagsInput Copy/Paste
FilamentFFilament / ❓┊help
16mo ago
TagsInput not displaying
FilamentFFilament / ❓┊help
3y ago