diff --git a/src/Fields/Layouts.php b/src/Fields/Layouts.php index f75663d..ea06315 100644 --- a/src/Fields/Layouts.php +++ b/src/Fields/Layouts.php @@ -125,7 +125,7 @@ public function getFilledLayouts(): LayoutCollection ); } - $filled = $values->map(function (LayoutItem $data) use ($layouts) { + $filled = $values ? $values->map(function (LayoutItem $data) use ($layouts) { /** @var ?Layout $layout */ $layout = $layouts->findByName($data->getName()); @@ -168,7 +168,7 @@ public function getFilledLayouts(): LayoutCollection ->headingAdditionalFields($fields); return $layout->removeButton($this->getRemoveButton()); - })->filter(); + })->filter() : []; return LayoutCollection::make($filled); }