parfum/app/Enums/UserStatus.php
2025-12-08 13:46:22 +07:00

39 lines
799 B
PHP

<?php
namespace App\Enums;
use App\Traits\WithCommentEnum;
use App\Traits\WithValueEnum;
enum UserStatus: int
{
use WithCommentEnum, WithValueEnum;
case ACTIVE = 1;
case INACTIVE = 2;
public function label(): string
{
return match ($this) {
self::ACTIVE => 'Aktif',
self::INACTIVE => 'Tidak Aktif',
};
}
public function color(): string
{
return match ($this) {
self::ACTIVE => 'emerald',
self::INACTIVE => 'yellow',
};
}
public function gradient(): string
{
return match ($this) {
self::ACTIVE => 'bg-gradient-to-b from-emerald-800 to-emerald-400',
self::INACTIVE => 'bg-gradient-to-b from-yellow-800 to-yellow-400',
};
}
}