© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
4 replies
michaelcarajeleascov

Access current record data from within getRelations

Guys, do you know if it is possible to access data from the current record within the getRelations method?

Something like:

public static function getRelations(): array
{

$participantType = $this->ownerRecord->type;

if ($participantType === 'participant') {
$relationsManagers[] = PartnersRelationManager::class;
} elseif ($participantType === 'partner') {
$relationsManagers[] = ParticipantRelationManager::class;
}

}

Thanks!
Solution
https://filamentphp.com/docs/3.x/panels/resources/relation-managers#conditionally-showing-relation-managers
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

Access current record within Widget
FilamentFFilament / ❓┊help
2y ago
access current record from custom view
FilamentFFilament / ❓┊help
3y ago
Repeater access current $record
FilamentFFilament / ❓┊help
3y ago
Access record data
FilamentFFilament / ❓┊help
3y ago