© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
1 reply
swilla

Dynamically loaded Widgets do not refresh when changing filters on the page

I'm loading widgets on a page like this:
public function getWidgets(): array
    {
        $communityFilter = $this->filters['communityId'] ?? null;
        $community = Community::find($communityFilter) ?? auth()->user()->community;

        $community->load('metrics');

        return $community->metrics->map(function ($metric) {
            return MetricWidget::make([
                'headering' => $metric->title,
                'metric' => $metric,
            ]);
        })->toArray();
    }
public function getWidgets(): array
    {
        $communityFilter = $this->filters['communityId'] ?? null;
        $community = Community::find($communityFilter) ?? auth()->user()->community;

        $community->load('metrics');

        return $community->metrics->map(function ($metric) {
            return MetricWidget::make([
                'headering' => $metric->title,
                'metric' => $metric,
            ]);
        })->toArray();
    }


I have a FilterAction setup to allow selecing a community. The dynamic headers I setup work, but the MetricWidgets never reload with the new widget. Is there a way to clear these and re-add them on filter change or force a refresh?
image.png
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

Filters in page to change the widgets
FilamentFFilament / ❓┊help
2y ago
Dynamically set the order for the widgets on each page
FilamentFFilament / ❓┊help
2y ago
auto refresh filament page when changing code?
FilamentFFilament / ❓┊help
14mo ago
footer widgets goes missing after changing table filters
FilamentFFilament / ❓┊help
3y ago