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() /**