How to check for current page from a resource

I'm trying to conditionally render some relation managers depending on if the user is currently viewing the resource from either the view page or edit page, from inside the getRelations() method of the Resource, is there a way of calculating what page is being used?
3 Replies
Dennis Koch
Dennis Koch2y ago
->visibleOn('edit'/'create') or ->visible(fn ($context) => $context == 'edit'
yandos666
yandos666OP2y ago
@Dennis Koch thats for individual form elements right? This is disabling the relationManager entirely
Dennis Koch
Dennis Koch2y ago
Sorry. Didn’t read properly You can set them per page. Just define the method on the page. The naming might be a bit different
Want results from more Discord servers?
Add your server