You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

BillStatus.php 602B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace App\Enums\Accounting;
  3. use Filament\Support\Contracts\HasColor;
  4. use Filament\Support\Contracts\HasLabel;
  5. enum BillStatus: string implements HasColor, HasLabel
  6. {
  7. case Partial = 'partial';
  8. case Paid = 'paid';
  9. case Unpaid = 'unpaid';
  10. case Void = 'void';
  11. public function getLabel(): ?string
  12. {
  13. return $this->name;
  14. }
  15. public function getColor(): string | array | null
  16. {
  17. return match ($this) {
  18. self::Partial, self::Unpaid => 'warning',
  19. self::Paid => 'success',
  20. self::Void => 'gray',
  21. };
  22. }
  23. }