41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Enums;
|
|
|
|
use Filament\Support\Contracts\HasColor;
|
|
use Filament\Support\Contracts\HasIcon;
|
|
use Filament\Support\Contracts\HasLabel;
|
|
|
|
enum InvoiceStatus: string implements HasColor, HasIcon, HasLabel
|
|
{
|
|
case UNPAID = 'Not paid';
|
|
case PARTIALLY_PAID = 'Partially paid';
|
|
case PAID = 'Paid';
|
|
case VOID = 'Void';
|
|
|
|
public function getLabel(): ?string
|
|
{
|
|
return $this->value;
|
|
}
|
|
|
|
public function getColor(): string|array|null
|
|
{
|
|
return match ($this) {
|
|
self::UNPAID => 'danger',
|
|
self::PARTIALLY_PAID => 'warning',
|
|
self::PAID => 'success',
|
|
self::VOID => 'gray'
|
|
};
|
|
}
|
|
|
|
public function getIcon(): ?string
|
|
{
|
|
return match ($this) {
|
|
self::UNPAID => IconEnum::UNPAID->value,
|
|
self::PARTIALLY_PAID => IconEnum::PARTIALLY_PAID->value,
|
|
self::PAID => IconEnum::PAID->value,
|
|
self::VOID => IconEnum::VOID->value,
|
|
};
|
|
}
|
|
}
|