diff --git a/app/Enums/InvoiceStatus.php b/app/Enums/InvoiceStatus.php index 5f8d995..ec8eedc 100644 --- a/app/Enums/InvoiceStatus.php +++ b/app/Enums/InvoiceStatus.php @@ -8,4 +8,24 @@ enum InvoiceStatus: string case POSTED = 'posted'; case VOID = 'void'; case PAID = 'paid'; + + public function label(): string + { + return match ($this) { + self::DRAFT => 'Draft', + self::POSTED => 'Posted', + self::VOID => 'Voided', + self::PAID => 'Paid', + }; + } + + public function color(): string + { + return match ($this) { + self::DRAFT => 'gray', + self::POSTED => 'green', + self::VOID => 'zinc', + self::PAID => 'blue', + }; + } } diff --git a/resources/views/components/⚡invoice-list.blade.php b/resources/views/components/⚡invoice-list.blade.php index e4b7a8e..18fd3ef 100644 --- a/resources/views/components/⚡invoice-list.blade.php +++ b/resources/views/components/⚡invoice-list.blade.php @@ -1,5 +1,6 @@ - +