@php if (!isset($field['wrapperAttributes']) || !isset($field['wrapperAttributes']['data-init-function'])){ $field['wrapperAttributes']['data-init-function'] = 'bpFieldInitUploadMultipleElement'; } if (!isset($field['wrapperAttributes']) || !isset($field['wrapperAttributes']['data-field-name'])) { $field['wrapperAttributes']['data-field-name'] = $field['name']; } @endphp
@include('crud::inc.field_translatable_icon') {{-- Show the file picker on CREATE form. --}}
isset($field['value']) && $field['value']!=null?'file_input backstrap-file-input':'file_input backstrap-file-input']) multiple >
{{-- HINT --}} @if (isset($field['hint']))

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

@endif {{-- Show the file name and a "Clear" button on EDIT form. --}} @if (isset($field['value'])) @php if (is_string($field['value'])) { $values = json_decode($field['value'], true) ?? []; } else { $values = $field['value']; } if(isset($field['value_key'])){ $values = $values->toArray()[$field['value_key']]; } @endphp @if (count($values))
@foreach($values as $key => $file_path) @php $file_name = $file_path; if(strpos($file_path, '/')){ $file_path_array = explode('/', $file_path); $file_name = end($file_path_array); } @endphp
@if (isset($field['temporary'])) {{ $file_name }} @else {{ $file_name }} @endif
@endforeach
@endif @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 @push('crud_fields_styles') @endpush @push('crud_fields_scripts') @endpush @endif