© 2026 Hedgehog Software, LLC

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

Hide relationmanager while viewing infolist

Is it possible to hide a relationmanager (for everyone) when an infolist is viewed?
I think some code has to be added to the 'Resource view page' or must it be done by using policies?
Solution
https://filamentphp.com/docs/3.x/panels/resources/relation-managers#conditionally-showing-relation-managers

eg:
class ActivitiesRelationManager extends RelationManager
{
    //...
    public static function canViewForRecord(Model $ownerRecord, string $pageClass): bool
    {
        if ($pageClass === ViewStaffMember::class) {
            return false;
        }
        return parent::canViewForRecord($ownerRecord, $pageClass);
    }
}
class ActivitiesRelationManager extends RelationManager
{
    //...
    public static function canViewForRecord(Model $ownerRecord, string $pageClass): bool
    {
        if ($pageClass === ViewStaffMember::class) {
            return false;
        }
        return parent::canViewForRecord($ownerRecord, $pageClass);
    }
}
Managing relationships - Panel Builder - Filament
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

Hide Actions on RelationManager
FilamentFFilament / ❓┊help
2y ago
Relationmanager in Livewire Infolist component
FilamentFFilament / ❓┊help
2y ago
use RelationManager in InfoList modal?
FilamentFFilament / ❓┊help
3y ago
Problem with Viewing Related Records in RelationManager
FilamentFFilament / ❓┊help
10mo ago