feat(enum): add IsActive enum

This commit is contained in:
Yoga Pangestu 2025-10-24 08:28:56 +07:00
parent ee7e62ebd8
commit bcc442a00b

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

@ -0,0 +1,30 @@
<?php
namespace App\Enums;
use App\Traits\Enum\WithComment;
use App\Traits\Enum\WithValue;
enum IsActive: int
{
use WithComment, WithValue;
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 => 'success',
self::INACTIVE => 'danger',
};
}
}