Pārlūkot izejas kodu

FIX ErrorException: Undefined array key "enabled"

if account type is "credit_card"  ToggleButton "enabled"  does not exist
and an exception occurs https://flareapp.io/share/17xwZk1P
3.x
bogusbd 1 gadu atpakaļ
vecāks
revīzija
bf9b00d980

+ 1
- 1
app/Filament/Company/Resources/Banking/AccountResource/Pages/CreateAccount.php Parādīt failu

@@ -23,7 +23,7 @@ class CreateAccount extends CreateRecord
23 23
 
24 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 28
         return $data;
29 29
     }

Notiek ielāde…
Atcelt
Saglabāt