© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
5 replies
Vp

table column visibility base on record

I am trying to set the table column visibility base on some record, but it's showing error
Argument #1 ($record) must be of type App\Models\Candidate, null given
Argument #1 ($record) must be of type App\Models\Candidate, null given


What I've tried:
Tables\Columns\TextColumn::make('name')
    ->visible(fn (Candidate $record): bool => $record->is_complete) // is_complete is boolean column
Tables\Columns\TextColumn::make('name')
    ->visible(fn (Candidate $record): bool => $record->is_complete) // is_complete is boolean column

But the same function for
->visible()
->visible()
is working fine in actions
My code which is working for action:
Tables\Actions\ViewAction::make()
    ->visible(fn (Candidate $record): bool => $record->is_complete),
Tables\Actions\ViewAction::make()
    ->visible(fn (Candidate $record): bool => $record->is_complete),

So, what should be the error here?
Solution
This was asked quite some times here. You cannot hide table columns based on a record, because that would result in a bad table layout.
Jump to solution
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

Icon Visibility on Text Column depending on record value
FilamentFFilament / ❓┊help
3y ago
Tab base Table column show .
FilamentFFilament / ❓┊help
3y ago
Hidden Column on $record
FilamentFFilament / ❓┊help
3y ago
Table Data Visibility
FilamentFFilament / ❓┊help
3y ago