#20570·filament

Table filters trigger shows a 0 badge when no filter is active

Author: YezperCreated Sep 26, 2026Updated Sep 26, 2026

Package

filament/filament

Package Version

v5.8.4

Laravel Version

v13.33.0

Livewire Version

v4.4.6

PHP Version

PHP 8.5.6

Problem description

The table's filters trigger (the funnel icon button) shows a badge reading 0 whenever the table has at least one filter and none is active.

resources/views/index.blade.php in filament/tables calls $filtersTriggerAction->badge($activeFiltersCount) at four call sites, on every render. HasBadge::badge() stores the int 0 as the string "0", and the icon button renders its badge when filled($badge), which is true for "0".

Expected behavior

No badge on the filters trigger while no filter is active; a count once one is.

Steps to reproduce

  1. Fresh Laravel 13 app, composer require filament/filament:^5.8, php artisan filament:install --panels.
  2. php artisan make:filament-resource User --generate.
  3. Add one filter to UsersTable: Filter::make('verified')->query(fn (Builder $query): Builder => $query->whereNotNull('email_verified_at')).
  4. Open /admin/users: the filters trigger carries a 0 badge.

The repository below has a test for it: php artisan test --filter=FilterBadgeTest fails with the badge rendered. Changing the four calls to ->badge($activeFiltersCount ?: null) makes it pass.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/byjesper/filament-filter-badge-zero-repro

Relevant log output

No response