浏览代码

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年前
父节点
当前提交
bf9b00d980
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      app/Filament/Company/Resources/Banking/AccountResource/Pages/CreateAccount.php

+ 1
- 1
app/Filament/Company/Resources/Banking/AccountResource/Pages/CreateAccount.php 查看文件

@@ -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
     }

正在加载...
取消
保存