© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3mo ago•
12 replies
Vp

CheckboxList description with relationships

I have table called technologies which has
id, name, description
id, name, description
and I am displaying this using checkboxlist like below

CheckboxList::make('technologies')
    ->required()
    ->relationship(titleAttribute: 'name');
CheckboxList::make('technologies')
    ->required()
    ->relationship(titleAttribute: 'name');

Since CheckboxList can also display description, I want it to display my technologies description as well, I try like below

->descriptions(fn() => Technologies::pluck('description', 'id')->toArray());
->descriptions(fn() => Technologies::pluck('description', 'id')->toArray());


And yes this introduce duplicate query, and I cannot use
fn(Model $record)
fn(Model $record)
because of relationships (maybe)

I call this from UserForm, and users -> technologies relationships is
public function technologies(): BelongsToMany
{
    return $this->belongsToMany(Technology::class);
}
public function technologies(): BelongsToMany
{
    return $this->belongsToMany(Technology::class);
}


So, how can I display correct description on checkboxlist descriptions without duplicate query and thanks in advance
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

CheckBoxList relationships error
FilamentFFilament / ❓┊help
3y ago
CheckboxList description per option?
FilamentFFilament / ❓┊help
3y ago
Set description for CheckboxList dynamically
FilamentFFilament / ❓┊help
2y ago
CheckboxList - set description from relationship record
FilamentFFilament / ❓┊help
3y ago