@php $multiple = array_get($field, 'multiple', true); $sortable = array_get($field, 'sortable', false); $value = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? ''; if (!$multiple && is_array($value)) { $value = array_first($value); } if (!isset($field['wrapperAttributes']) || !isset($field['wrapperAttributes']['data-init-function'])) { $field['wrapperAttributes']['data-init-function'] = 'bpFieldInitBrowseMultipleElement'; if ($multiple) { $field['wrapperAttributes']['data-popup-title'] = trans('backpack::crud.select_files'); $field['wrapperAttributes']['data-multiple'] = "true"; } else { $field['wrapperAttributes']['data-popup-title'] = trans('backpack::crud.select_file'); $field['wrapperAttributes']['data-multiple'] = "false"; } $field['wrapperAttributes']['data-only-mimes'] = json_encode($field['mime_types'] ?? []); if($sortable){ $field['wrapperAttributes']['sortable'] = "true"; } } @endphp
@include('crud::inc.field_translatable_icon')
@if ($multiple) @foreach( (array)$value as $v) @if ($v)
@if ($sortable) @endif
@endif @endforeach @else @endif
@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 ($crud->fieldTypeNotLoaded($field)) @php $crud->markFieldTypeAsLoaded($field); @endphp {{-- FIELD CSS - will be loaded in the after_styles section --}} @push('crud_fields_styles') @endpush @push('crud_fields_scripts') @endpush @endif {{-- End of Extra CSS and JS --}} {{-- ########################################## --}}