parfum/app/Enums/ExpenseType.php

34 lines
666 B
PHP

<?php
namespace App\Enums;
use App\Traits\Enums\WithCommentEnum;
use App\Traits\Enums\WithValueEnum;
enum ExpenseType: int
{
use WithCommentEnum, WithValueEnum;
case OPERATIONAL = 1;
case PURCHASE = 2;
case SALARY = 3;
public function label(): string
{
return match ($this) {
self::OPERATIONAL => 'Operasional',
self::PURCHASE => 'Belanja',
self::SALARY => 'Gaji',
};
}
public function color(): string
{
return match ($this) {
self::OPERATIONAL => 'emerald',
self::PURCHASE => 'rose',
self::SALARY => 'cyan',
};
}
}