© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
5 replies
Harvey

Custom table columns per table tab

I'm moving from Nova, and basically want to replicate what a Lense does in Filament.

So when I switch to my "Pending Payments" tab, I want to also add a column showing "payment total".

Is this at all possible? Or do I need to have separate pages/tables linked to these tabs?
Solution
So the filament version of a lens would be using filter tabs on the "ListRecords" page class: https://filamentphp.com/docs/3.x/panels/resources/listing-records#using-tabs-to-filter-the-records

On your columns you can use a callback in hidden() to inject $livewire which will give you the instance of ListRecords, you can then use that to check the current tab.

Let's say you have the following on the ListRecords page:
public function getTabs(): array
{
    return [
        'all' => Tab::make(),
        'active' => Tab::make()
            ->modifyQueryUsing(fn (Builder $query) => $query->where('active', true)),
        'inactive' => Tab::make()
            ->modifyQueryUsing(fn (Builder $query) => $query->where('active', false)),
    ];
}
public function getTabs(): array
{
    return [
        'all' => Tab::make(),
        'active' => Tab::make()
            ->modifyQueryUsing(fn (Builder $query) => $query->where('active', true)),
        'inactive' => Tab::make()
            ->modifyQueryUsing(fn (Builder $query) => $query->where('active', false)),
    ];
}


On a table you could do the following to make the 'active' column only show on the all tab:
Tables\Columns\IconColumn::make('active')
    ->boolean()
    ->hidden(fn ($livewire) => $livewire->activeTab !== 'all')
Tables\Columns\IconColumn::make('active')
    ->boolean()
    ->hidden(fn ($livewire) => $livewire->activeTab !== 'all')
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
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

custom background columns in table grid
FilamentFFilament / ❓┊help
2y ago
Change table columns/filters based on active tab?
FilamentFFilament / ❓┊help
12mo ago
Table columns
FilamentFFilament / ❓┊help
2y ago
Table reload in custom livewire tab by updating in another tab table record.
FilamentFFilament / ❓┊help
16mo ago