Detect current action "mode"
Hi guys,
I don't know how to search for this, but is there any way to detect the current action "mode" from a resource?
For example, in the form() function, is there some kind of property that holds the current "mode" for that resource?
I'm not searching for ->hiddenOn() functions, but it's pretty much what it does. Something like $form->getCurrentAction() or so (which would return me 'create', 'edit' or 'view').
Thanks!
1 Reply
->hidden(fn($context) => $context === 'edit'))
$context is available in the callbacks