{{-- select2 --}} @php $field ??= []; $field['fake'] ??= false; $field['allows_null'] ??= false; $entityModel = !empty($xPanel) ? $xPanel->model : null; $isNullAllowed = is_null($entityModel) || $entityModel::isColumnNullable($field['name']); $entityEntries = $field['model']::all(); $fieldValue = $field['value'] ?? ($field['default'] ?? null); $fieldValue = old($field['name'], $fieldValue); @endphp
@include('admin.panel.fields.inc.translatable_icon') {{-- HINT --}} @if (isset($field['hint']))
{!! $field['hint'] !!}
@endif
{{-- ########################################## --}} {{-- Extra CSS and JS for this particular field --}} {{-- If a field type is shown multiple times on a form, the CSS and JS will only be loaded once --}} @if ($xPanel->checkIfFieldIsFirstOfItsType($field, $fields)) {{-- FIELD CSS - will be loaded in the after_styles section --}} @push('crud_fields_styles') {{-- include select2 css--}} @endpush {{-- FIELD JS - will be loaded in the after_scripts section --}} @push('crud_fields_scripts') {{-- include select2 js--}} @endpush @endif {{-- End of Extra CSS and JS --}} {{-- ########################################## --}}