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.

EstimateStatus.php 889B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace App\Enums\Accounting;
  3. use App\Enums\Concerns\ParsesEnum;
  4. use Filament\Support\Contracts\HasColor;
  5. use Filament\Support\Contracts\HasLabel;
  6. enum EstimateStatus: string implements HasColor, HasLabel
  7. {
  8. use ParsesEnum;
  9. case Draft = 'draft';
  10. case Sent = 'sent';
  11. case Approved = 'approved';
  12. case Accepted = 'accepted';
  13. case Rejected = 'rejected';
  14. case Expired = 'expired';
  15. case Converted = 'converted';
  16. public function getLabel(): ?string
  17. {
  18. return $this->name;
  19. }
  20. public function getColor(): string | array | null
  21. {
  22. return match ($this) {
  23. self::Draft => 'gray',
  24. self::Sent => 'primary',
  25. self::Approved, self::Accepted => 'success',
  26. self::Rejected => 'danger',
  27. self::Expired => 'warning',
  28. self::Converted => 'info',
  29. };
  30. }
  31. }