{{-- select2 from array --}} @php $field ??= []; $field['options'] ??= []; $field['allows_multiple'] ??= false; $field['allows_null'] ??= false; $name = $field['name']; $name = $field['allows_multiple'] ? $name . '[]' : $name; $multipleAttr = $field['allows_multiple'] ? ' multiple' : ''; $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 --}} {{-- ########################################## --}}