Preventing the display of a related resource on a view or edit page.

How can I prevent the display of a resource on either a view or an edit page?
Solution:
You may override the getRelationManagers() method of the View or Edit page and return an empty array to disable the display ```php public function getRelationManagers(): array {...
Jump to solution
4 Replies
Dennis Koch
Dennis Koch8mo ago
Can you give more information?!
BuddhaNature
BuddhaNature8mo ago
Hi, @Dennis Koch - thanks for responding. When I use make:filament-relation-manager to create a related resource, that resource appears under the content of both the view and the edit pages. I'd like to be able to control the display of the related data to be on one or both of those pages.
Dennis Koch
Dennis Koch8mo ago
Hm I understand now, but I am not sure whether/how that works. Sorry
Solution
@uwascan
@uwascan8mo ago
You may override the getRelationManagers() method of the View or Edit page and return an empty array to disable the display
public function getRelationManagers(): array
{
return [];
}
public function getRelationManagers(): array
{
return [];
}