31 lines
536 B
PHP
31 lines
536 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use App\Traits\WithCommentEnum;
|
|
use App\Traits\WithValueEnum;
|
|
|
|
enum IsPaid: int
|
|
{
|
|
use WithCommentEnum, WithValueEnum;
|
|
|
|
case PAID = 1;
|
|
case NOT_PAID = 2;
|
|
|
|
public function label(): string
|
|
{
|
|
return match ($this) {
|
|
self::PAID => 'Dibayar',
|
|
self::NOT_PAID => 'Belum Dibayar',
|
|
};
|
|
}
|
|
|
|
public function color(): string
|
|
{
|
|
return match ($this) {
|
|
self::PAID => 'emerald',
|
|
self::NOT_PAID => 'red',
|
|
};
|
|
}
|
|
}
|