F
Filament•2mo 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(),
Select::make('container_id')
->label('container_id')
->options(fn() => ContainerList::pluck('container_nm', 'container_nm')->toArray())
->searchable()
->live(),
1 Reply
Dennis Koch
Dennis Koch•2mo ago
I think there should be a getSearchRecordsUsing() method or something

Did you find this page helpful?