Browse Source

Merge pull request #37 from bogusbd/small-fixes

smaill fixes
3.x
Andrew Wallo 1 year ago
parent
commit
ec56e8ece6
No account linked to committer's email address

+ 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::DEFAULT)
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([

+ 1
- 1
app/Filament/Company/Resources/Banking/AccountResource/Pages/CreateAccount.php View File

23
 
23
 
24
     protected function mutateFormDataBeforeCreate(array $data): array
24
     protected function mutateFormDataBeforeCreate(array $data): array
25
     {
25
     {
26
-        $data['enabled'] = (bool) $data['enabled'];
26
+        $data['enabled'] = (bool) ($data['enabled'] ?? false);
27
 
27
 
28
         return $data;
28
         return $data;
29
     }
29
     }

Loading…
Cancel
Save