© 2026 Hedgehog Software, LLC

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

Action refresh Select field value

Hello, I'm building an action and trying to refresh the select field but I cannot make it work, can someone point me out how to do that?

->action(function (array $data, Program $record, Select $component): void {
                            $statePath = $component->getStatePath();
                            
                            $data['entity']['type'] = 'organizer';
                            $entity = Entity::create($data['entity']);

                            $users = !empty($data['users']) ? $data['users'] : [];
                            foreach ($users as $user) {
                                $user = User::create($user);
                            }
                        
                            $record->entity()->associate($entity->id);
                            $record->save();

                            /** @var LivewireComponent $livewire */
                            $livewire = $component->getLivewire();
                            $livewire->dispatch('filament-forms::select.refreshSelectedOptionLabel', livewireId: $livewire->getId(), statePath: $statePath);

                        })
->action(function (array $data, Program $record, Select $component): void {
                            $statePath = $component->getStatePath();
                            
                            $data['entity']['type'] = 'organizer';
                            $entity = Entity::create($data['entity']);

                            $users = !empty($data['users']) ? $data['users'] : [];
                            foreach ($users as $user) {
                                $user = User::create($user);
                            }
                        
                            $record->entity()->associate($entity->id);
                            $record->save();

                            /** @var LivewireComponent $livewire */
                            $livewire = $component->getLivewire();
                            $livewire->dispatch('filament-forms::select.refreshSelectedOptionLabel', livewireId: $livewire->getId(), statePath: $statePath);

                        })


Thank you in advance,
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

Select field default value
FilamentFFilament / ❓┊help
3y ago
Table refresh based on select value
FilamentFFilament / ❓┊help
17mo ago
Filament Action: Select field value missing from $data when using multiple()
FilamentFFilament / ❓┊help
5mo ago
Select Field Options Key And Value
FilamentFFilament / ❓┊help
2y ago