|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Enums;
|
|
|
|
|
|
|
|
use Filament\Support\Contracts\HasColor;
|
|
|
|
use Filament\Support\Contracts\HasIcon;
|
|
|
|
use Filament\Support\Contracts\HasLabel;
|
|
|
|
|
|
|
|
enum OrderStatus: string implements HasColor, HasIcon, HasLabel
|
|
|
|
{
|
|
|
|
case DRAFT = 'Draft';
|
|
|
|
case APPROVED = 'Approved';
|
|
|
|
case PRODUCTION = 'Production';
|
|
|
|
case SHIPPED = 'Shipped';
|
|
|
|
case INVOICED = 'Invoiced';
|
|
|
|
|
|
|
|
public function getLabel(): ?string
|
|
|
|
{
|
|
|
|
return $this->value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getColor(): string|array|null
|
|
|
|
{
|
|
|
|
return match ($this) {
|
|
|
|
self::DRAFT => 'gray',
|
|
|
|
self::APPROVED => 'success',
|
|
|
|
self::PRODUCTION => 'primary',
|
|
|
|
self::SHIPPED => 'warning',
|
|
|
|
self::INVOICED => 'invoiced',
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getIcon(): ?string
|
|
|
|
{
|
|
|
|
return match ($this) {
|
|
|
|
self::DRAFT => 'heroicon-o-pencil',
|
|
|
|
self::APPROVED => 'heroicon-o-check',
|
|
|
|
self::PRODUCTION => 'heroicon-o-arrow-path',
|
|
|
|
self::SHIPPED => 'heroicon-o-paper-airplane',
|
|
|
|
self::INVOICED => 'heroicon-o-credit-card',
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|