{{-- select2 from array --}} @php $field['allows_null'] = $field['allows_null'] ?? $crud->model::isColumnNullable($field['name']); $field['value'] = old_empty_or_null($field['name'], '') ?? ($field['value'] ?? ($field['default'] ?? '')); $field['multiple'] = $field['allows_multiple'] ?? false; $field['placeholder'] = $field['placeholder'] ?? ($field['multiple'] ? trans('backpack::crud.select_entries') : trans('backpack::crud.select_entry')); @endphp @include('crud::fields.inc.wrapper_start') {{-- To make sure a value gets submitted even if the "select multiple" is empty, we need a hidden input --}} @if ($field['multiple']) @endif {{-- HINT --}} @if (isset($field['hint']))

{!! $field['hint'] !!}

@endif @include('crud::fields.inc.wrapper_end') {{-- ########################################## --}} {{-- 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 --}} {{-- FIELD JS - will be loaded in the after_scripts section --}} @push('crud_fields_scripts') @loadOnce('bpFieldInitSelect2FromArrayElement') @endLoadOnce @endpush {{-- End of Extra CSS and JS --}} {{-- ########################################## --}}