#Descriptions on CheckboxList (relationship)

3 messages · Page 1 of 1 (latest)

gritty dust
#

Hi, I'm using this to display permissions in my user management system. Is it possible to load descriptions from the relationship without explicitly defining them in the descriptions method?

 Forms\Components\CheckboxList::make('permissions')
                            ->label('')
                            ->relationship(
                                titleAttribute: 'display_name',
                                modifyQueryUsing: fn (Builder $query) => $query->orderBy('order'),
                            )
                            ->bulkToggleable()
                            ->columns(2),
burnt oysterBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

jovial moth
#

Maybe you can use getOptionLabelFromRecordUsing and return a custom blade view that also contains the description?