© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•12mo ago•
9 replies
mohdaftab

Stats widget above the table linked to the table data

Hello,
I have added this DashboardTable widget in my Dashboard and added the filters to search.
I am looking to add some stats at the top of the table from all the paginated results and those stats should be linked to the search filters used in the table.

Please let me know how to do that?

Thank you
image.png
Solution
use this in your table widget

public function updated(string $name, string $value)
{
    if (str($name)->contains('tableFilters')) {
        $this->dispatch('refreshStatsWidget', value: $value);
    }
}

public function resetTableFiltersForm(): void
{
    parent::resetTableFiltersForm();
    $this->dispatch('refreshStatsWidget');
}
public function updated(string $name, string $value)
{
    if (str($name)->contains('tableFilters')) {
        $this->dispatch('refreshStatsWidget', value: $value);
    }
}

public function resetTableFiltersForm(): void
{
    parent::resetTableFiltersForm();
    $this->dispatch('refreshStatsWidget');
}


in your stats widgets you can do this

use Livewire\Attributes\On;
...

public $tableFilter = null;

#[On('refreshStatsWidget')]
public function refreshStatsWidget(?string $value = null): void
{
    $this->tableFilter = $value;
}
use Livewire\Attributes\On;
...

public $tableFilter = null;

#[On('refreshStatsWidget')]
public function refreshStatsWidget(?string $value = null): void
{
    $this->tableFilter = $value;
}


$this->tableFilter
$this->tableFilter
will contain the table filter value
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

Table data in widget
FilamentFFilament / ❓┊help
2y ago
Trying to populate data from the table to widget
FilamentFFilament / ❓┊help
2y ago
Stats widget filter
FilamentFFilament / ❓┊help
12mo ago
Stats widget columns
FilamentFFilament / ❓┊help
2y ago