© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•16mo ago•
3 replies
SokarNox

Advanced Tables Filter Not Adding Filter

What I'm trying to do:

Hello, this is a very simple table, I'm trying to add an Advanced Table Filter for "created_at". Thank you in advance, maybe I'm doing something wrong, maybe something is wrong with the package?

What I did:

I added a simple filter to the table

My Issue/The error:

My filter is be removed (and not shown on in the filter menu) by the following code:
Archilex\AdvancedTables\Filters
Archilex\AdvancedTables\Filters
method
getCollectedFilters
getCollectedFilters
on line
110
110
using version
3.7.27
3.7.27
of package
archilex/filament-filter-sets
archilex/filament-filter-sets


The line in question is removing all filters where it's an instance of AdvancedFilter (which makes no sense)
->reject(function (BaseFilter $filter) {
    return $this->isColumnFilter($filter);
})

protected function isColumnFilter($filter): bool
{
  return
    $filter instanceof TextFilter ||
    $filter instanceof NumericFilter ||
    $filter instanceof DateFilter ||
    $filter instanceof SelectFilter;
}
->reject(function (BaseFilter $filter) {
    return $this->isColumnFilter($filter);
})

protected function isColumnFilter($filter): bool
{
  return
    $filter instanceof TextFilter ||
    $filter instanceof NumericFilter ||
    $filter instanceof DateFilter ||
    $filter instanceof SelectFilter;
}


My Code:

->filters([
  AdvancedFilter::make()
  ->filters([
    DateFilter::make('created_at'),
  ])
])
->columns([
  // ...
  TextColumn::make('created_at')
    ->dateTime('m/d/Y h:i A')
    ->label('Date')
    ->timezone(auth()->user()->timezone)
    ->sortable(),
])
->filters([
  AdvancedFilter::make()
  ->filters([
    DateFilter::make('created_at'),
  ])
])
->columns([
  // ...
  TextColumn::make('created_at')
    ->dateTime('m/d/Y h:i A')
    ->label('Date')
    ->timezone(auth()->user()->timezone)
    ->sortable(),
])
Solution
This was already discussed offline earlier today, but since I’m just now seeing this was posted here too I’ll respond here too:

The issue you are having is the DateFilter is what I call a “columnFilter” this means you need to use the
->includeColumns()
->includeColumns()
method on your filter.

So to break it down:

If you want to autogenerate your filters based on your table columns (including ‘created_at’) then all you need is:
AdvancedFilter::make()
    ->includeColumns() // you are missing this.
AdvancedFilter::make()
    ->includeColumns() // you are missing this.

If you just want the DateFilter for created at then you can pass that into the
->includeColumns()
->includeColumns()
method:
AdvancedFilter::make()
    ->includeColumns([
        'created_at'
    ]);
AdvancedFilter::make()
    ->includeColumns([
        'created_at'
    ]);

You only need to use the
->filters()
->filters()
method if you want to a) don’t want to autogenerate filters (which also means you can’t use column filters), b) you want to override a column filter, or c) if you want to include a custom filter (ie filter data on your table where you don’t have a column for it)

Hope that helps!

p.s. please use the advanced-tables channel and feel free to tag me so I get notified.
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

Advanced filters
FilamentFFilament / ❓┊help
3y ago
Advanced Tables (Plugin) Example / advice.
FilamentFFilament / ❓┊help
2y ago
Issue with Installing Advanced Tables Plugin on Windows
FilamentFFilament / ❓┊help
2y ago
Adding filter to custom widget
FilamentFFilament / ❓┊help
3y ago