{{-- INPUT --}}
@if($custom_field->type === 'Input')
@endif
{{-- TEXTAREA --}}
@if($custom_field->type === 'Textarea' || $custom_field->type === 'TextArea')
@endif
{{-- PHONE --}}
@if($custom_field->type === 'Phone')
@endif
{{-- URL --}}
@if($custom_field->type === 'Url')
@endif
{{-- NUMBER --}}
@if($custom_field->type === 'Number')
@endif
@php
$currentValue = $model[$custom_field->name] ?? '';
if ($currentValue === null || trim((string) $currentValue) === '' || strtolower(trim((string) $currentValue)) === 'null') {
$currentValue = '';
} else {
$currentValue = trim((string) $currentValue);
}
@endphp
{{-- SELECT --}}
@if($custom_field->type === 'Select')
@php
$values = $custom_field->values ?? [];
$exists = false;
foreach ($values as $value) {
$optionValue = trim((string) $value);
if ($currentValue === $optionValue) {
$exists = true;
break;
}
}
@endphp
@endif
{{-- DROPDOWN --}}
@if($custom_field->type === 'Dropdown')
@php
$options = is_array($custom_field->options) ? $custom_field->options : [];
$exists = false;
foreach ($options as $option) {
$optionValue = trim((string) $option);
if ($currentValue === $optionValue) {
$exists = true;
break;
}
}
@endphp
@endif
{{-- SWITCH --}}
@if($custom_field->type === 'Switch')
getCustomFieldValue($custom_field->id) ? 'checked' : '' }}>
@endif
{{-- DATE --}}
@if($custom_field->type === 'Date')
@endif
{{-- TIME --}}
@if($custom_field->type === 'Time')
@endif
{{-- DATETIME --}}
@if($custom_field->type === 'DateTime')
@endif
{{-- HIDDEN --}}
@if($custom_field->type === 'Hidden')
@endif