您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

DocumentType.php 567B

1234567891011121314151617181920212223242526
  1. <?php
  2. namespace App\Enums;
  3. use Filament\Support\Contracts\{HasIcon, HasLabel};
  4. enum DocumentType: string implements HasIcon, HasLabel
  5. {
  6. case Invoice = 'invoice';
  7. case Bill = 'bill';
  8. public const DEFAULT = self::Invoice->value;
  9. public function getLabel(): ?string
  10. {
  11. return $this->name;
  12. }
  13. public function getIcon(): ?string
  14. {
  15. return match ($this->value) {
  16. self::Invoice->value => 'heroicon-o-document-duplicate',
  17. self::Bill->value => 'heroicon-o-clipboard-document-list',
  18. };
  19. }
  20. }