@inject('fmrepo', 'App\Repositories\FileManagerRepository') @php $start_folder = ''; if (isset($attributes['start_folder']) && $attributes['start_folder'] != '') { $start_folder = $attributes['start_folder']; } $selected_files = []; $multiple = false; // dump(); if (isset($attributes['multiple']) && $attributes['multiple']) { $multiple = true; } $without_label = false; if (Ui::keyset($attributes, 'without_label') != null) { $without_label = $attributes['without_label']; } if ( Ui::keyset($attributes, 'layout') == null || (Ui::keyset($attributes, 'layout') != null && $attributes['layout'] == 'h') ) { $horizental = true; $row = ' row'; $labelClass = 'col-2 col-form-label'; } else { $horizental = false; $row = ''; $labelClass = 'col-form-label'; } $random = Str::random(); $id_name_field = $name . '_' . $random; if (isset($attributes['required']) && $attributes['required'] === true) { $labelClass .= ' required'; } @endphp
@if (!$without_label) {{ Form::label($name, Ui::prettify(__('ui.' . Str::replaceLast('[]', '', $name))), ['class' => $labelClass]) }} @endif @if ($horizental)
@endif @if ($multiple) @php $newly = ''; if ($value) { foreach ($value as $val) { $selected_files[] = $val['file']; } $newly = implode('|||', $selected_files); } elseif (old($name) != null) { $newly = old($name); $selected_files = explode('|||', $newly); } @endphp Select Files
@if (isset($selected_files) && is_array($selected_files) && count($selected_files) > 0) @foreach ($selected_files as $fi) @php $file = $fmrepo->getThumbFileManager($fi); @endphp @endforeach @endif
@else
Remove @if ($value) {{ Form::text($name, $value[0]['file'], array_merge(['class' => 'form-control', 'readonly', 'id' => $id_name_field], $attributes)) }} @else {{ Form::text($name, '', array_merge(['class' => 'form-control', 'readonly', 'id' => $id_name_field], $attributes)) }} @endif Select File
@endif @if ($horizental)
@endif