© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
20 replies
DianaMujoiu

CheckboxList group options

I have this checkbox list
CheckboxList::make('amenities')
    ->label('')
    ->columns(5)
    ->relationship('realEstateAmenities', 'name')
    ->options(RealEstateAmenity::all()
     ->groupBy('is_searchable')
     ->map(function ($amenitiesGroup) {
       return $amenitiesGroup->pluck('name', 'id');
      })->toArray())
CheckboxList::make('amenities')
    ->label('')
    ->columns(5)
    ->relationship('realEstateAmenities', 'name')
    ->options(RealEstateAmenity::all()
     ->groupBy('is_searchable')
     ->map(function ($amenitiesGroup) {
       return $amenitiesGroup->pluck('name', 'id');
      })->toArray())
. I want to group the options by is_searchable but the field waits for a string and I give it an array. Is there a way to group the options and put a label for searchable and non searchable?
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Group options of a CheckboxList
FilamentFFilament / ❓┊help
2y ago
Checkboxlist selecting all options
FilamentFFilament / ❓┊help
2y ago
CheckboxList Relationship Options Descriptions
FilamentFFilament / ❓┊help
3y ago
Checkboxlist disable specific options
FilamentFFilament / ❓┊help
3y ago