© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
29 replies
namrata

Custom option label in multiple select

I have tried getOptionLabelUsing and getOptionLabelFromRecordUsing() both but my the options are not as I wanted. I have faced this when the select field is multiple.

getOptionLabelFromRecordUsing() this works in single select option but not in multiple
Solution
Instead of pluck, use map with keys, eg:
          ->options(function () {
            return Model::all()->mapWithKeys(function ($model) {
              return [$model->id => $model->name . $model->id ...];
              });
          })
          ->options(function () {
            return Model::all()->mapWithKeys(function ($model) {
              return [$model->id => $model->name . $model->id ...];
              });
          })
Jump to solution
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Modifying the option label in Select
FilamentFFilament / ❓┊help
3y ago
Select->multiple() in SelectColumn?
FilamentFFilament / ❓┊help
12mo ago
Selected option's label does not update in select field
FilamentFFilament / ❓┊help
3y ago
getOptionLabelUsing is not working for custom option label result in Select
FilamentFFilament / ❓┊help
3y ago