© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
ziolupo

Conditional widget based on RelationManager

I have a resource with two relationmanager:
    public static function getRelations(): array
    {
        return [
            RelationManagers\ProposalRelationManager::class,
            RelationManagers\PartecipantsRelationManager::class,
        ];
    }
    public static function getRelations(): array
    {
        return [
            RelationManagers\ProposalRelationManager::class,
            RelationManagers\PartecipantsRelationManager::class,
        ];
    }


The problem is that I want to show different widgets, based on different table when I switch tab from one relation to the other.
As showed above I have Proposal a Partecipant resource with different widgets

Inside the edit page I have:
    protected function getHeaderWidgets(): array
    {
        return [
          ProposalResource\Widgets\ProposalOverview::class,
        ];
    }
    protected function getHeaderWidgets(): array
    {
        return [
          ProposalResource\Widgets\ProposalOverview::class,
        ];
    }

but of course it's ok when the I hit the "proposal Tab", but when I'm clicking the Partecipant tab, I would like to load another widget.

Is this possible?
Thank you!
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

Hide RelationManager card based on certain condition
FilamentFFilament / ❓┊help
3y ago
Conditionally show widget based on record
FilamentFFilament / ❓┊help
2y ago
Hide column in relationmanager based on parent model
FilamentFFilament / ❓┊help
3y ago
Placeholder content based on conditional logic based on value from another component?
FilamentFFilament / ❓┊help
3y ago