F
Filamentβ€’2y ago
Crylar

Is it possible to hide Badge based on the value?

I have the following code and would love to hide for that row when "children_count" is 0. What are my options? Thanks.
return $table
->columns([
Tables\Columns\TextColumn::make('title'),
Tables\Columns\BadgeColumn::make('children_count')
->label('')
->icon('heroicon-o-tag')
->counts('children')

])
return $table
->columns([
Tables\Columns\TextColumn::make('title'),
Tables\Columns\BadgeColumn::make('children_count')
->label('')
->icon('heroicon-o-tag')
->counts('children')

])
4 Replies
Dennis Koch
Dennis Kochβ€’2y ago
I guess it's not possible. You could try formatStateUsing() but that will probably also show an empty b adge
Crylar
CrylarOPβ€’2y ago
It actually worked, thanks @Dennis Koch for pointing to the right direction. πŸ™‚
Dennis Koch
Dennis Kochβ€’2y ago
Nice.
Crylar
CrylarOPβ€’2y ago
when you return null in a state it skips, cool πŸ™‚
Want results from more Discord servers?
Add your server