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:
-
Check Plugin Version Compatibility: Ensure that the version of the
Advanced Tablesplugin you are using is compatible with your version of Filament. Sometimes, method signatures or available methods can change between versions. -
Update Dependencies: Run
composer updateto make sure all your dependencies are up to date. This can sometimes resolve issues caused by outdated packages. -
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(),
]),
]);
}
-
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.
-
Consult Plugin Documentation: Refer to the Advanced Tables plugin documentation for any specific notes or updates regarding the usage of filters and columns.
-
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.