© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•6mo ago•
2 replies
Sahil Sayyad

Preventing StatsOverviewWidget from refreshing after every table action

What I am trying to do:
I want to show a custom ContactStatsWidget (extending Filament\Widgets\StatsOverviewWidget) in my resource page footer alongside my main table. It should only query once when the page loads, not every time I run an action on the table (like adding a guest).

What I did:

Added my widget inside getFooterWidgets() of my resource.

The widget works, but every table action refreshes it and runs the query again.

I tried ->lazy(), caching the query, etc., but it still refreshes on every action.

My issue/the error:
How can I prevent StatsOverviewWidget from re-running its query every time an action refreshes the page? Ideally, it should only load once (or only refresh when I explicitly tell it to).

Code:

use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Card;

class ContactStatsWidget extends BaseWidget
{
protected function getCards(): array
{
return [
Card::make('Total Contacts', Contact::count()),
Card::make('Event Contacts', ContactEvent::count()),
];
}
}


And inside my resource:

public static function getFooterWidgets(): array
{
return [
ContactStatsWidget::class,
];
}
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Refreshing Table after Attach Action
FilamentFFilament / ❓┊help
2y ago
Refreshing table records after a page action
FilamentFFilament / ❓┊help
3y ago
Refreshing parent page after an action in a relation table
FilamentFFilament / ❓┊help
3y ago