© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
22 replies
pocket.racer

How to do IconColumn with reverse boolean?

Usually when I want do do an IconColumn with boolean i just do this

IconColumn::make('is_human_at')
  ->boolean()
IconColumn::make('is_human_at')
  ->boolean()


However i have a column that need the reverse so I tried to do this

IconColumn::make('is_human_at')
    ->label('is_robot')
    ->icons([
        'heroicon-o-check-circle' => fn (?string $state): bool => $state !== null,
        'heroicon-o-x-circle' => fn (?string $state): bool => $state !== null,
    ])
    ->colors([
        'success' => fn (?string $state): bool => $state !== null,
        'danger' => fn (?string $state): bool => $state !== null,
    ]),
IconColumn::make('is_human_at')
    ->label('is_robot')
    ->icons([
        'heroicon-o-check-circle' => fn (?string $state): bool => $state !== null,
        'heroicon-o-x-circle' => fn (?string $state): bool => $state !== null,
    ])
    ->colors([
        'success' => fn (?string $state): bool => $state !== null,
        'danger' => fn (?string $state): bool => $state !== null,
    ]),


However for the 2nd one, only the danger red shows, when it is supposed to be green it does not show at all
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

For IconColumn, only show boolean icon when true?
FilamentFFilament / ❓┊help
2y ago
Using `icons` with IconColumn
FilamentFFilament / ❓┊help
3y ago
IconColumn enum
FilamentFFilament / ❓┊help
3y ago
Access to Livewire in IconColumn
FilamentFFilament / ❓┊help
3y ago