parfum/app/Enums/AuditStockStatus.php

34 lines
708 B
PHP

<?php
namespace App\Enums;
use App\Traits\Enums\WithCommentEnum;
use App\Traits\Enums\WithValueEnum;
enum AuditStockStatus: string
{
use WithCommentEnum, WithValueEnum;
case INCREASED = 'Menambah';
case DECREASED = 'Mengurangi';
case UPDATED = 'Mengubah';
public function label(): string
{
return match ($this) {
self::INCREASED => 'Menambah',
self::DECREASED => 'Mengurangi',
self::UPDATED => 'Mengubah',
};
}
public function color(): string
{
return match ($this) {
self::INCREASED => 'emerald',
self::DECREASED => 'red',
self::UPDATED => 'yellow',
};
}
}