SokarNox
SokarNox
FFilament
Created by SokarNox on 10/22/2024 in #❓┊help
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 method getCollectedFilters on line 110 using version 3.7.27 of package 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(),
])
4 replies