@php Assets::addScriptsDirectly('vendor/core/core/base/js/repeater-field.js'); $values = array_values(is_array($value) ? $value : (array) json_decode($value ?: '[]', true)); $added = []; if (! empty($values)) { for ($index = 0; $index < count($values); $index++) { $group = ''; foreach ($fields as $key => $field) { $group .= view('core/base::forms.partials.repeater-item', compact('name', 'index', 'key', 'field', 'values')); } $added[] = view('core/base::forms.partials.repeater-group', compact('group')); } } $group = ''; foreach ($fields as $key => $field) { $group .= view('core/base::forms.partials.repeater-item', [ 'name' => $name, 'index' => '__key__', 'key' => $key, 'field' => $field, 'values' => [], ]); } $defaultFields = [view('core/base::forms.partials.repeater-group', compact('group'))->render()]; $repeaterId = 'repeater_field_' . md5($name) . uniqid('_'); @endphp