@php $wrapper = $input->copy(); $ignore = ($ig = $wrapper->hidden('ignore')) ? (is_array($ig) ? $ig : [$ig]) : []; $baseInputs = ($inps = $wrapper->hidden('inputs')) && is_array($inps) ? $inps : []; $baseName = $wrapper->name; $mlcValue = $input->value; if (!is_array($mlcValue)) { $mlcValue = []; } @endphp
@if (count($languages = get_language_packages()))
@foreach ($languages as $lang) @continue(in_array($lang->slug, $ignore)) @php $inputs = []; $g = $mlcValue[$lang->slug] ?? []; $groupValue = is_array($g) ? $g : []; foreach ($baseInputs as $key => $inp) { $newInp = $inp; $name = $inp['name']??$key; $value = $groupValue[$name] ?? null; $n = explode('[', $name); $n[0] = $wrapper->name . '[' . $lang->slug . ']' . '[' . $n[0] . ']'; $name = implode('[', $n); $inp['name'] = $name; if ($value) { $inp['value'] = $value; } $inputs[] = $inp; } $formConfig = [ 'inputs' => $inputs, 'data' => $groupValue, 'config' => [ 'layout_type' => 'default', ], 'attrs' => [], 'group_title' => '' ]; @endphp
@include('app.forms.simple-input-list', $formConfig)
@endforeach
@endif