@php
$fields_html = '';
foreach ($customFields as $field) {
$model_value = $customFieldsValues[$field->id]??null;
$fieldType = strtolower($field->field_type);
$fieldName = str_replace(' ', '_', $field->field_name); // Replace spaces with underscores
$fieldName = preg_replace('/[^A-Za-z0-9_]/', '', $fieldName); // Remove other special characters
$fieldValue = (!empty($field->field_values) && $field->field_values != '[]') ? json_decode($field->field_values, true) : null;
$attributes = $fieldType == 'dropdown' ? 'class="form-select "' :'class="form-control "'; // Initialize empty string for attributes
if (!empty($custom_attr)) {
foreach ($custom_attr as $key => $value) {
$attributes .= " $key='$value'"; // Build attribute string
}
}
$fields_html .= '
';
}
@endphp
{!! $fields_html !!}