F
Filamentβ€’10mo ago
khairulazmi_

Set Tags Color base on database value

Hello everyone . I am trying to populate tags on table using badge and the color will base on database value . Right now my solution was
TextColumn::make('tag.name')
->label('Tags')
->badge()
->color(function($state){
return Color::hex(Tag::where('name', $state)->first()->color);
}),
TextColumn::make('tag.name')
->label('Tags')
->badge()
->color(function($state){
return Color::hex(Tag::where('name', $state)->first()->color);
}),
Which I think can be improve , because I dont want to re querying Tag again .. Thank you πŸ˜„
No description
1 Reply
khairulazmi_
khairulazmi_OPβ€’10mo ago
Anyone has solution for this ?
Want results from more Discord servers?
Add your server