瀏覽代碼

constant instead of string to prevent possible errors

3.x
bogusbd 1 年之前
父節點
當前提交
e8ebdde765
共有 1 個檔案被更改,包括 2 行新增2 行删除
  1. 2
    2
      app/Filament/Company/Resources/Banking/AccountResource.php

+ 2
- 2
app/Filament/Company/Resources/Banking/AccountResource.php 查看文件

@@ -60,7 +60,7 @@ class AccountResource extends Resource
60 60
                                     ->options(AccountType::class)
61 61
                                     ->localizeLabel()
62 62
                                     ->searchable()
63
-                                    ->default('checking')
63
+                                    ->default(AccountType::Checking->value)
64 64
                                     ->live()
65 65
                                     ->required(),
66 66
                                 Forms\Components\TextInput::make('name')
@@ -81,7 +81,7 @@ class AccountResource extends Resource
81 81
                                     ->localizeLabel('Default')
82 82
                                     ->onLabel(translate('Yes'))
83 83
                                     ->offLabel(translate('No'))
84
-                                    ->hidden(static fn (Forms\Get $get) => $get('type') === 'credit_card'),
84
+                                    ->hidden(static fn (Forms\Get $get) => $get('type') === AccountType::CreditCard->value),
85 85
                             ])->columns(),
86 86
                         Forms\Components\Section::make('Currency & Balance')
87 87
                             ->schema([

Loading…
取消
儲存