toLivewire(); foreach ($data as $key => $child) { $data[$key] = $dehydrateChild($key, $child); } return [ $data, ['class' => get_class($target)], ]; } function hydrate($value, $meta, $hydrateChild) { foreach ($value as $key => $child) { $value[$key] = $hydrateChild($key, $child); } return $meta['class']::fromLivewire($value); } function set(&$target, $key, $value) { $target->{$key} = $value; } }