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

31 lines
545 B
PHP

<?php
namespace App\Enums;
use App\Traits\WithCommentEnum;
use App\Traits\WithValueEnum;
enum VoucherType: int
{
use WithCommentEnum, WithValueEnum;
case FIXED = 1;
case PERCENTAGE = 2;
public function label(): string
{
return match ($this) {
self::FIXED => 'Nominal',
self::PERCENTAGE => 'Persentase',
};
}
public function color(): string
{
return match ($this) {
self::FIXED => 'blue',
self::PERCENTAGE => 'pink',
};
}
}