From 4edc13d0f571776df9d182f064170ae830017af6 Mon Sep 17 00:00:00 2001 From: wychoong <67364036+wychoong@users.noreply.github.com> Date: Wed, 20 Nov 2024 06:24:29 +0800 Subject: [PATCH] Fix: panel Attributes field exclude section/group with empty attributes (#2020) **before** ![image](https://github.com/user-attachments/assets/26dcff52-f662-498e-aab9-541baee0d606) --------- Co-authored-by: Author --- packages/admin/src/Support/Forms/Components/Attributes.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/admin/src/Support/Forms/Components/Attributes.php b/packages/admin/src/Support/Forms/Components/Attributes.php index 429b3fde6..4f474aa80 100644 --- a/packages/admin/src/Support/Forms/Components/Attributes.php +++ b/packages/admin/src/Support/Forms/Components/Attributes.php @@ -61,7 +61,8 @@ protected function setUp(): void 'model' => $group, 'fields' => $attributes->groupBy('attribute_group_id')->get($group->id, []), ]; - }); + }) + ->filter(fn ($group) => count($group['fields'])); $groupComponents = [];