Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

RileyGWeb's avatar

Filament Advanced Tables plugin filters not working properly

I am using the Advanced Tables plugin for Filament, trying to implement advanced filters using automatic mapping. I get this error:

Method Filament\Tables\Columns\TextColumn::isNumeric does not exist.

This is my table code:

    public static function table(Table $table): Table
    {
        return $table
            ->columns([
                Tables\Columns\TextColumn::make('name')->sortable()->searchable(),
                Tables\Columns\TextColumn::make('description'),
                Tables\Columns\TextColumn::make('quantity')->sortable(),
                Tables\Columns\TextColumn::make('set.name')->label('Set')->sortable(),
                Tables\Columns\TextColumn::make('set.location.name')->label('Location')->sortable(),
                Tables\Columns\TextColumn::make('created_at')->date(),
            ])
            ->filters([
                AdvancedFilter::make()
                    ->includeColumns()
            ])
            ->filtersLayout(FiltersLayout::AboveContentCollapsible)
            ->actions([
                Tables\Actions\EditAction::make(),
            ])
            ->bulkActions([
                Tables\Actions\BulkActionGroup::make([
                    Tables\Actions\DeleteBulkAction::make(),
                ]),
            ]);
    }

It seems like it's mapping the wrong filters to the text column: https://filamentphp.com/plugins/kenneth-sese-advanced-tables#automatic-column-mapping

It happens if even if I remove all columns besides just name. Unrelated, but when I remove ->filtersLayout(FiltersLayout::AboveContentCollapsible), I get:

Undefined constant Filament\Tables\Enums\FiltersLayout::Modal

It almost seems like there is something wrong with my installation of the plugin or filament, but I've installed/updated composer 1,000 times and no luck.

Any ideas?

0 likes
2 replies
LaryAI's avatar
Level 58

It looks like you're encountering issues with the Advanced Tables plugin for Filament, specifically with the automatic column mapping for filters. The error Method Filament\Tables\Columns\TextColumn::isNumeric does not exist suggests that the plugin is trying to call a method that doesn't exist on the TextColumn class.

Here are a few steps to troubleshoot and potentially resolve the issue:

  1. Check Plugin Version Compatibility: Ensure that the version of the Advanced Tables plugin you are using is compatible with your version of Filament. Sometimes, method signatures or available methods can change between versions.

  2. Update Dependencies: Run composer update to make sure all your dependencies are up to date. This can sometimes resolve issues caused by outdated packages.

  3. Manual Filter Configuration: If automatic mapping is causing issues, you can manually configure the filters for each column. This way, you have more control over what filters are applied and can avoid methods that don't exist.

Here is an example of how you can manually configure the filters:

use Filament\Tables;
use Filament\Tables\Filters\Filter;

public static function table(Table $table): Table
{
    return $table
        ->columns([
            Tables\Columns\TextColumn::make('name')->sortable()->searchable(),
            Tables\Columns\TextColumn::make('description'),
            Tables\Columns\TextColumn::make('quantity')->sortable(),
            Tables\Columns\TextColumn::make('set.name')->label('Set')->sortable(),
            Tables\Columns\TextColumn::make('set.location.name')->label('Location')->sortable(),
            Tables\Columns\TextColumn::make('created_at')->date(),
        ])
        ->filters([
            Filter::make('name')
                ->query(fn ($query, $value) => $query->where('name', 'like', "%{$value}%")),
            Filter::make('description')
                ->query(fn ($query, $value) => $query->where('description', 'like', "%{$value}%")),
            Filter::make('quantity')
                ->query(fn ($query, $value) => $query->where('quantity', $value)),
            Filter::make('set.name')
                ->query(fn ($query, $value) => $query->whereHas('set', fn ($query) => $query->where('name', 'like', "%{$value}%"))),
            Filter::make('set.location.name')
                ->query(fn ($query, $value) => $query->whereHas('set.location', fn ($query) => $query->where('name', 'like', "%{$value}%"))),
            Filter::make('created_at')
                ->query(fn ($query, $value) => $query->whereDate('created_at', $value)),
        ])
        ->filtersLayout(FiltersLayout::AboveContentCollapsible)
        ->actions([
            Tables\Actions\EditAction::make(),
        ])
        ->bulkActions([
            Tables\Actions\BulkActionGroup::make([
                Tables\Actions\DeleteBulkAction::make(),
            ]),
        ]);
}
  1. Check for Typos and Correct Usage: Ensure that you are using the correct classes and methods as per the documentation. Sometimes, a simple typo or incorrect method chaining can cause such issues.

  2. Consult Plugin Documentation: Refer to the Advanced Tables plugin documentation for any specific notes or updates regarding the usage of filters and columns.

  3. Reinstall the Plugin: If you suspect that the installation might be corrupted, try removing and reinstalling the plugin:

    composer remove kenneth-sese/advanced-tables
    composer require kenneth-sese/advanced-tables
    

If none of these steps resolve the issue, consider reaching out to the plugin's maintainers or the community for further assistance. They might have more insights or updates regarding this specific problem.

RileyGWeb's avatar

@LaryAI Unfortunately, implementing your code gave me this error:

An attempt was made to evaluate a closure for [Filament\Tables\Filters\Filter], but [$value] was unresolvable.

Please or to participate in this conversation.