feat(enum): memuat global enum IsActive

This commit is contained in:
Yoga Pangestu 2025-09-28 21:32:29 +07:00
parent b53e873bb8
commit 2b2ed20cbf

38
app/Enums/IsActive.php Normal file
View File

@ -0,0 +1,38 @@
<?php
namespace App\Enums;
use App\Traits\WithCommentEnum;
use App\Traits\WithValueEnum;
enum IsActive: int
{
use WithCommentEnum, WithValueEnum;
case ACTIVE = 1;
case INACTIVE = 2;
public function label()
{
return match ($this) {
self::ACTIVE => 'Aktif',
self::INACTIVE => 'Tidak Aktif',
};
}
public function color()
{
return match ($this) {
self::ACTIVE => 'emerald',
self::INACTIVE => 'red',
};
}
public function icon()
{
return match ($this) {
self::ACTIVE => 'check-circle',
self::INACTIVE => 'x-circle',
};
}
}