From 29ec35979b43844826dbd6e87ba3d608eb76e8ce Mon Sep 17 00:00:00 2001 From: milewski Date: Thu, 25 Feb 2021 00:24:07 +0800 Subject: [PATCH] fix incompatibility issue with json-wrapper --- src/HasConditionalContainer.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/HasConditionalContainer.php b/src/HasConditionalContainer.php index 2594519..52b906a 100644 --- a/src/HasConditionalContainer.php +++ b/src/HasConditionalContainer.php @@ -2,6 +2,7 @@ namespace DigitalCreative\ConditionalContainer; +use DigitalCreative\JsonWrapper\JsonWrapper; use Illuminate\Http\Resources\MergeValue; use Illuminate\Support\Collection; use Laravel\Nova\Contracts\RelatableField; @@ -261,6 +262,12 @@ private function flattenDependencies(NovaRequest $request, array $fields) } + if ($field instanceof JsonWrapper) { + + return $this->flattenDependencies($fakeRequest, $field->fields); + + } + return [ $field ]; }); @@ -322,6 +329,12 @@ private function findAllContainers($fields): Collection } + if ($field instanceof JsonWrapper) { + + return $this->findAllContainers($field->fields); + + } + }) ->filter() /**