@php
$type = $fieldType($fieldKey);
$options = $fieldOptions($fieldKey);
@endphp
@if ($type === 'radio' && count($options))
@php($radioColumns = in_array($fieldKey, ['sex', 'marital_status'], true) ? 2 : count($options))
@foreach (array_chunk($options, $radioColumns, true) as $optionRow)
@foreach ($optionRow as $value => $label)
|
|
@endforeach
@for ($i = count($optionRow); $i < $radioColumns; $i++)
|
@endfor
@endforeach
@elseif ($type === 'checkbox' && count($options))
@foreach (array_chunk($options, 3, true) as $optionRow)
@foreach ($optionRow as $value => $label)
|
@if ($isSelected($fieldKey, $value))
✔
@endif
|
{{ $label }} |
|
@endforeach
@for ($i = count($optionRow); $i < 3; $i++)
|
@endfor
@endforeach
@else
{{ $v($fieldKey) }}
@endif