Hide a resource widget based on the resource status
Hey everyone. I found the option to hide a widget on a resource with this function:
public static function canView(): bool
The issue is that I want to only show the widget if the resource record/model is in a certain status. But I can't access the record because the function is static. Does anyone know a workaround?
What I would like to do but doesn't work:
Something that feels hacky that works:
public static function canView(): bool
The issue is that I want to only show the widget if the resource record/model is in a certain status. But I can't access the record because the function is static. Does anyone know a workaround?
What I would like to do but doesn't work:
Something that feels hacky that works: