@if (isset($fields) && count($fields) > 0)
merge(['class' => 'row p-20']) }}> @foreach ($fields as $field)
@if ($field->type == 'text')
@elseif($field->type == 'password')
@elseif($field->type == 'number')
@elseif($field->type == 'textarea')
@elseif($field->type == 'radio')
@foreach ($field->values as $key => $value)
@endforeach
@elseif($field->type == 'select')
@php $selectValues = is_string($field->values) ? json_decode($field->values, true) : $field->values; $selectedValue = $model ? ($model->custom_fields_data['field_' . $field->id] ?? '') : ''; @endphp
@foreach ($selectValues ?? [] as $key => $optionLabel)
{{ $optionLabel }}
@endforeach
@elseif($field->type == 'date')
@elseif($field->type == 'checkbox')
@php $checkedValues = ''; foreach (json_decode($field->values) as $key => $value) { if ($model && $model->custom_fields_data['field_'.$field->id] != '' && in_array($value ,explode(', ', $model->custom_fields_data['field_'.$field->id]))) { $checkedValues .= ($checkedValues == '') ? $value : ', '.$value; } } @endphp
@foreach (json_decode($field->values) as $key => $value)
@endforeach
@elseif ($field->type == 'file')
@endif
@endforeach
@endif