Zoltes
Combining preloaded options and search results in Forms\Components\Select
@PovilasKorop yes, you were correct about the front-end source of the delay.
Thank you for the tip! It got much better.
I tested it with the debugbar and found out the value of 250 ms to be the lowest one that makes no extra requests when I type 3-4 chars.
I've also cut out requests to DB under 2 chars length
->searchDebounce(250)
->getSearchResultsUsing(fn (string $search): array =>
mb_strlen($search) > 1
?
Client::->where('name', 'like', '%'.mb_strtolower($search).'%')->limit(10)->pluck('name', 'id')->toArray()
:
[])
4 replies