34 lines
696 B
PHP
34 lines
696 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use App\Traits\WithCommentEnum;
|
|
use App\Traits\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',
|
|
};
|
|
}
|
|
}
|