Browse Source

constant instead of string to prevent possible errors

3.x
bogusbd 1 year ago
parent
commit
e8ebdde765
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      app/Filament/Company/Resources/Banking/AccountResource.php

+ 2
- 2
app/Filament/Company/Resources/Banking/AccountResource.php View File

60
                                     ->options(AccountType::class)
60
                                     ->options(AccountType::class)
61
                                     ->localizeLabel()
61
                                     ->localizeLabel()
62
                                     ->searchable()
62
                                     ->searchable()
63
-                                    ->default('checking')
63
+                                    ->default(AccountType::Checking->value)
64
                                     ->live()
64
                                     ->live()
65
                                     ->required(),
65
                                     ->required(),
66
                                 Forms\Components\TextInput::make('name')
66
                                 Forms\Components\TextInput::make('name')
81
                                     ->localizeLabel('Default')
81
                                     ->localizeLabel('Default')
82
                                     ->onLabel(translate('Yes'))
82
                                     ->onLabel(translate('Yes'))
83
                                     ->offLabel(translate('No'))
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
                             ])->columns(),
85
                             ])->columns(),
86
                         Forms\Components\Section::make('Currency & Balance')
86
                         Forms\Components\Section::make('Currency & Balance')
87
                             ->schema([
87
                             ->schema([

Loading…
Cancel
Save