@php
$address = $config['form']['navbar']['address']['input'];
$k_last = array_key_last($address);
@endphp
@foreach ($address as $k_n => $n)
@if (empty($n['status']))
@continue
@endif
@if (str_contains($k_n, 'row_'))
@foreach ($n as $k_i => $i)
@if (empty($i['status']))
@continue
@endif
@php
$chk_req = !empty($i['validate']);
$label = $i['label'] ?? __("field.{$k_i}");
$readonly = !empty($i['readonly']);
@endphp
@if (in_array($i['type'], ['input', 'mail', 'tel', 'number']))
@elseif ($i['type'] == 'select')
@php
$selected = null;
if (str_contains($k_i, '_id')) {
$new_k_i = str_replace('_id', '', $k_i);
$selected = $data->{$new_k_i} ?? null;
} elseif (!empty($data->{$k_i}[0])) {
$f = $data->{$k_i}[0];
$selected = (object) ['id' => $f->id, 'name' => $f->local->name];
}
@endphp
@endif
@endforeach
@else
@php
$chk_req = !empty($n['validate']);
$label = __("field.{$k_n}");
@endphp
@if (in_array($n['type'], ['text']))
@endif
@endif
@endforeach