You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
topnotch_website/app/Enums/OrderStatus.php

44 lines
1.1 KiB
PHTML

3 months ago
<?php
namespace App\Enums;
2 months ago
use Filament\Support\Contracts\HasColor;
use Filament\Support\Contracts\HasIcon;
use Filament\Support\Contracts\HasLabel;
enum OrderStatus: string implements HasColor, HasIcon, HasLabel
3 months ago
{
2 months ago
case DRAFT = 'Draft';
3 months ago
case APPROVED = 'Approved';
3 months ago
case PRODUCTION = 'Production';
3 months ago
case SHIPPED = 'Shipped';
case INVOICED = 'Invoiced';
2 months ago
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 => 'lucide-pencil',
self::APPROVED => 'lucide-check-check',
self::PRODUCTION => 'lucide-refresh-cw',
self::SHIPPED => 'lucide-send',
self::INVOICED => 'lucide-credit-card',
2 months ago
};
}
3 months ago
}