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 Koch13mo ago
Can you give more information?!
BuddhaNature
BuddhaNatureOP13mo 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 Koch13mo ago
Hm I understand now, but I am not sure whether/how that works. Sorry
Solution
@uwascan
@uwascan13mo 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 [];
}
Want results from more Discord servers?
Add your server