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())
. 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?
Was this page helpful?