© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•16mo ago•
7 replies
Guido

Conditionally hide SelectColumn based on email domain

I'm working on a Laravel project using FilamentPHP and need some help conditionally hiding a column in a table.
public static function table(Table $table): Table
{
    return $table
        ->columns([
            Tables\Columns\TextColumn::make('name')
                ->searchable(),
            Tables\Columns\TextColumn::make('email')
                ->searchable(),
            Tables\Columns\SelectColumn::make('department_id')
                ->label('Department')
                ->options(Department::all()->pluck('name', 'id')),
        ]);
}
public static function table(Table $table): Table
{
    return $table
        ->columns([
            Tables\Columns\TextColumn::make('name')
                ->searchable(),
            Tables\Columns\TextColumn::make('email')
                ->searchable(),
            Tables\Columns\SelectColumn::make('department_id')
                ->label('Department')
                ->options(Department::all()->pluck('name', 'id')),
        ]);
}

The
department_id
department_id
column should only display when the user’s email address does end with
@mycompany.com
@mycompany.com
. If it doesn't, I'd like this column to be hidden for that specific row.

Is there a way to conditionally hide a column based on a record's attribute like this in FilamentPHP?
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

Hide SelectColumn based on soft delete status
FilamentFFilament / ❓┊help
3y ago
SelectColumn give options based on record
FilamentFFilament / ❓┊help
3y ago
Conditionally hide relation manager
FilamentFFilament / ❓┊help
2y ago
Conditionally hide table summary
FilamentFFilament / ❓┊help
2y ago