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/InvoiceStatus.php

38 lines
847 B
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 PAID = 'Paid';
case VOID = 'Void';
public function getLabel(): ?string
{
return $this->value;
}
public function getColor(): string|array|null
{
return match ($this) {
self::UNPAID => 'warning',
self::PAID => 'success',
self::VOID => 'gray'
};
}
public function getIcon(): ?string
{
return match ($this) {
self::UNPAID => 'lucide-circle-x',
self::PAID => 'lucide-circle-check',
self::VOID => 'lucide-circle-slash',
};
}
}