@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
{!! $field['hint'] !!}
@endif