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
->visibleOn('edit'/'create')
or ->visible(fn ($context) => $context == 'edit'
@Dennis Koch thats for individual form elements right? This is disabling the relationManager entirely
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