Why select multiple is always searchable?
in my users table i have set this select for when i create a new user (modal):
im trying to set -
->searchable(false)
, but it is always searchable anyways. how to disable the search in a select multiple???Solution:Jump to solution
final code:
```php
Select::make('roles')
->multiple()
->relationship('roles', 'name')...
14 Replies
I don't think it's possible since we use ChoicesJS for multiselect which comes with a search.
in v3 is different, right? this can be done
I don't think there is any difference. We still use ChoicesJS
fak, okay 🤔
the thing is that id like to remove the search, cuz when i search the options change
i have them translated but then, as user search, i see them untranslated - https://discord.com/channels/883083792112300104/1141621034731188274
I think you should use a Callback on
->relationship()
(3rd param) to limit your relationship query and use getOptionLabelFromRecord()
method to format your options.would u mind to guide me a little bit on how to do this?
wdym to limit the query?
so far i did this:
You should be able to select maxItems(1) if memory serves me right.
how to do that? 🤔
it keeps the items translated when searching, but the search searches them by not translated
i mean that if i search "jugador", i see 0 results
when i should see 1 result
cuz is trying to search "player" instead
(player is jugador, but translated)
i fixed it!
Solution
final code:
so the thing is just preloading it
so it searches the translated options
else, searches in db, where arent translated and kinda bugs out if searching
Ah, sorry. Didn't realize that your translations aren't stored in the DB
its okayy, thanks y'all for ur time