@foreach($fields as $field) @if($field->type == "input")
@error($field->id)
{{ $message }}
@enderror
@elseif($field->type == "number")
@error($field->id)
{{ $message }}
@enderror
@elseif($field->type == "textarea")
@error($field->id)
{{ $message }}
@enderror
@elseif($field->type == "upload")
@error($field->id)
{{ $message }}
@enderror
@elseif($field->type == "date_picker")
@error($field->id)
{{ $message }}
@enderror
@elseif($field->type == "toggle")
id]) and $values[$field->id] == "on") ? 'checked' : ((!empty(old('fields.'.$field->id)) and old('fields.'.$field->id) == "on") ? 'checked' : '') }}>
@error($field->id)
{{ $message }}
@enderror
@elseif($field->type == "dropdown") @if(!empty($field->options) and count($field->options))
@error($field->id)
{{ $message }}
@enderror
@endif @elseif($field->type == "checkbox") @if(!empty($field->options) and count($field->options)) @php $checkboxValues = []; if (!empty($values) and !empty($values[$field->id])) { $checkboxValues = json_decode($values[$field->id], true); } else if (!empty(old('fields.'.$field->id)) and is_array(old('fields.'.$field->id))) { $checkboxValues = old('fields.'.$field->id); } @endphp
@foreach($field->options as $option)
id, $checkboxValues) ? 'checked' : "" }}>
@endforeach @error($field->id)
{{ $message }}
@enderror
@endif @elseif($field->type == "radio") @if(!empty($field->options) and count($field->options))
@foreach($field->options as $option)
id]) and $values[$field->id] == $option->id) ? 'checked' : ((!empty(old('fields.'.$field->id)) and old('fields.'.$field->id) == $option->id) ? 'checked' : '') }}>
@endforeach @error($field->id)
{{ $message }}
@enderror
@endif @endif @endforeach