parfum/app/Enums/PaymentMethod.php
2025-10-27 19:22:22 +07:00

37 lines
724 B
PHP

<?php
namespace App\Enums;
use App\Traits\WithCommentEnum;
use App\Traits\WithValueEnum;
enum PaymentMethod: int
{
use WithCommentEnum, WithValueEnum;
case CASH = 1;
case TRANSFER = 2;
case QRIS = 3;
case OTHER = 4;
public function label(): string
{
return match ($this) {
self::CASH => 'Tunai',
self::TRANSFER => 'Transfer Bank',
self::QRIS => 'QRIS',
self::OTHER => 'Lainnya',
};
}
public function color(): string
{
return match ($this) {
self::CASH => 'emerald',
self::TRANSFER => 'blue',
self::QRIS => 'purple',
self::OTHER => 'gray',
};
}
}