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

AccountType.php 492B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Enums;
  3. use Filament\Support\Contracts\HasLabel;
  4. enum AccountType: string implements HasLabel
  5. {
  6. case Checking = 'checking';
  7. case Savings = 'savings';
  8. case MoneyMarket = 'money_market';
  9. case CreditCard = 'credit_card';
  10. case Merchant = 'merchant';
  11. public const DEFAULT = self::Checking->value;
  12. public function getLabel(): ?string
  13. {
  14. $label = ucwords(str_replace('_', ' ', $this->value));
  15. return translate($label);
  16. }
  17. }