@php $current_value = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? ''; $entity_model = $crud->getRelationModel($field['entity'], - 1); $field['allows_null'] = $field['allows_null'] ?? $entity_model::isColumnNullable($field['name']); $field['toBeFilled'] = $field['toBeFilled'] ?? []; $field['toBeChecked'] = $field['toBeChecked'] ?? []; //if it's part of a relationship here we have the full related model, we want the key. if (is_object($current_value) && is_subclass_of(get_class($current_value), 'Illuminate\Database\Eloquent\Model') ) { $current_value = $current_value->getKey(); } if (!isset($field['options'])) { $options = $field['model']::all(); } else { $options = call_user_func($field['options'], $field['model']::query()); } @endphp @include('crud::fields.inc.wrapper_start') @include('crud::fields.inc.translatable_icon') {{-- HINT --}} @if (isset($field['hint']))
{!! $field['hint'] !!}
@endif @include('crud::fields.inc.wrapper_end') @if ($crud->fieldTypeNotLoaded($field)) @php $crud->markFieldTypeAsLoaded($field); @endphp @push('crud_fields_scripts') @endpush @endif