FilamentF
Filamentโ€ข10mo ago
Akiyama

How to Refresh Filament Select Field in Real-Time When New Records Are Added?

Hey everyone! ๐Ÿ‘‹

I have a Select field in Filament, which loads data from the database. However, I noticed an issue:

When a user opens the select dropdown, it preloads the data.
If another user adds a new record at the same time, the new record does not appear in the select field unless the page is refreshed.
Iโ€™m looking for a way to automatically refresh the select field so that newly added records are available without a full page reload.

I've tried using live(), reactive(), and even wire:poll, but the field doesnโ€™t update dynamically.

Is there an easy way to refresh the select options in real-time when new records are added? Any suggestions would be appreciated! ๐Ÿ™

Select::make('container_id')
                    ->label('container_id')
                    ->options(fn() => ContainerList::pluck('container_nm', 'container_nm')->toArray())
                    ->searchable()
                    ->live(),
Was this page helpful?