Set description for CheckboxList dynamically

Hi, how can I access the collection which is loaded from the relations method? I dont see how I can access the relationship data

CheckboxList::make('menuSections')
  ->hiddenLabel()
  ->relationship('sections', 'title')
  ->descriptions(function ($collection) {
    return $collection->pluck('description', 'id')->toArray();
  })
  ->bulkToggleable()
Was this page helpful?