We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here is how you can hide resources when switched to a tenant or to the system tenant in Nova using #5
trait TenantAwareResource { public static function availableForNavigation(Request $request) { $isTenantResource = static::$system === false; $isCustomerTenant = optional(app(Environment::class)->website())->is_admin_tenant !== true ?? false; return ($isTenantResource && $isCustomerTenant) || (!$isTenantResource && !$isCustomerTenant); } } trait IsSystemResource { use TenantAwareResource; protected static $system = true; } trait IsTenantResource { use TenantAwareResource; protected static $system = false; }
Then you simply need to use the trait in your resources to show/hide them based on the context.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Here is how you can hide resources when switched to a tenant or to the system tenant in Nova using #5
Some traits
Then you simply need to use the trait in your resources to show/hide them based on the context.
The text was updated successfully, but these errors were encountered: