mirror of
https://github.com/Cybrarist/Discount-Bandit.git
synced 2026-11-24 19:49:54 +01:00
29 lines
629 B
PHP
29 lines
629 B
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use Filament\Support\Contracts\HasColor;
|
|
use Filament\Support\Contracts\HasLabel;
|
|
use Illuminate\Contracts\Support\Htmlable;
|
|
|
|
enum ProductStatusEnum: string implements HasLabel, HasColor
|
|
{
|
|
case Active = 'active';
|
|
case Disabled = 'disabled';
|
|
case Silenced = 'silenced';
|
|
|
|
public function getColor(): string|array|null
|
|
{
|
|
return match ($this) {
|
|
self::Active => 'success',
|
|
self::Disabled => 'gray',
|
|
self::Silenced => 'warning',
|
|
};
|
|
}
|
|
|
|
public function getLabel(): string|Htmlable|null
|
|
{
|
|
return $this->name;
|
|
}
|
|
}
|