parfum/app/Enums/AuditStockStatus.php

37 lines
821 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';
case DELETED = 'Menghapus';
public function label(): string
{
return match ($this) {
self::INCREASED => 'Menambah',
self::DECREASED => 'Mengurangi',
self::UPDATED => 'Mengubah',
self::DELETED => 'Menghapus',
};
}
public function color(): string
{
return match ($this) {
self::INCREASED => 'emerald',
self::DECREASED => 'orange',
self::UPDATED => 'yellow',
self::DELETED => 'red',
};
}
}