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.

TaxType.php 853B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Enums;
  3. use Filament\Support\Contracts\HasColor;
  4. use Filament\Support\Contracts\HasIcon;
  5. use Filament\Support\Contracts\HasLabel;
  6. enum TaxType: string implements HasLabel, HasColor, HasIcon
  7. {
  8. case Sales = 'sales';
  9. case Purchase = 'purchase';
  10. case None = 'none';
  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::Sales => 'success',
  19. self::Purchase => 'warning',
  20. self::None => 'gray',
  21. };
  22. }
  23. public function getIcon(): ?string
  24. {
  25. return match ($this) {
  26. self::Sales => 'heroicon-o-currency-dollar',
  27. self::Purchase => 'heroicon-o-shopping-bag',
  28. self::None => 'heroicon-o-x-circle',
  29. };
  30. }
  31. }