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

DocumentType.php 596B

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