php-tenant/Enums/UserTier.php
Snider d0ad2737cb refactor: rename namespace from Core\Mod\Tenant to Core\Tenant
Simplifies the namespace hierarchy by removing the intermediate Mod
segment. Updates all 118 files including models, services, controllers,
middleware, tests, and composer.json autoload configuration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 16:30:46 +00:00

81 lines
2 KiB
PHP

<?php
namespace Core\Tenant\Enums;
enum UserTier: string
{
case FREE = 'free';
case APOLLO = 'apollo'; // Standard paid tier
case HADES = 'hades'; // Premium tier
public function label(): string
{
return match ($this) {
self::FREE => 'Free',
self::APOLLO => 'Apollo',
self::HADES => 'Hades',
};
}
public function color(): string
{
return match ($this) {
self::FREE => 'gray',
self::APOLLO => 'blue',
self::HADES => 'violet',
};
}
public function icon(): string
{
return match ($this) {
self::FREE => 'user',
self::APOLLO => 'sun',
self::HADES => 'crown',
};
}
public function maxWorkspaces(): int
{
return match ($this) {
self::FREE => 1,
self::APOLLO => 5,
self::HADES => -1, // Unlimited
};
}
public function features(): array
{
return match ($this) {
self::FREE => [
'basic_content_editing',
'single_workspace',
],
self::APOLLO => [
'basic_content_editing',
'advanced_content_editing',
'multiple_workspaces',
'analytics_basic',
'social_scheduling',
],
self::HADES => [
'basic_content_editing',
'advanced_content_editing',
'multiple_workspaces',
'unlimited_workspaces',
'analytics_basic',
'analytics_advanced',
'social_scheduling',
'social_automation',
'api_access',
'priority_support',
'white_label',
],
};
}
public function hasFeature(string $feature): bool
{
return in_array($feature, $this->features());
}
}