Skip to content

Commit aab069c

Browse files
maytham553maytham553-elitedanharrin
authored
Add handling for array item data in RepeatableEntry and update state … (#18809)
* Add handling for array item data in RepeatableEntry and update state retrieval in HasState * Update HasState.php --------- Co-authored-by: Maytham Mahdi <mmahdi@elitesoft.iq> Co-authored-by: Dan Harrin <git@danharrin.com>
1 parent e0ae4c9 commit aab069c

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

packages/infolists/src/Components/Concerns/HasState.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function getState(): mixed
6969

7070
$state = $containerState instanceof Model ?
7171
$this->getStateFromRecord($containerState) :
72-
data_get($containerState, $this->getStatePath());
72+
data_get($containerState, $this->getStatePath(isAbsolute: false));
7373
}
7474

7575
if (is_string($state) && ($separator = $this->getSeparator())) {

packages/infolists/src/Components/RepeatableEntry.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public function getChildComponentContainers(bool $withHidden = false): array
3636

3737
if ($itemData instanceof Model) {
3838
$container->record($itemData);
39+
} elseif (is_array($itemData)) {
40+
$container->state($itemData);
3941
}
4042

4143
$containers[$itemKey] = $container;

0 commit comments

Comments
 (0)