Select relationship with max one query

I'm trying to have a select menu with about 10 options queried from a database. Which are searchable for easy selection. However, on each keystroke the searchable queries the database which leads to high loading times. So I want it to only query once. Using options with a pluck() would work if I didn't need the relationship to save my data afterwards.
Select::make('labels')
->label('Labels')
->relationship('labels', 'name')
->preload()
->multiple()
Select::make('labels')
->label('Labels')
->relationship('labels', 'name')
->preload()
->multiple()
Does anyone have any suggestions to do this?
2 Replies
toeknee
toeknee4w ago
use: ->searchDebounce(1000) should be that already tbf
MindCoder
MindCoderOP4w ago
I mean for it to use the preloaded query to search in. Search debounce would merely slow the database querying. But thank you

Did you find this page helpful?