{{--
--}}
{{ html()->button(__('' . __('messages.lbl_choose_image')))->class('input-group-text form-control')->type('button')->attribute('onclick', "document.getElementById('file_url_media').click()")->style('height:16rem') }} {{ html()->file('file_url[]')->id('file_url_media')->class('form-control')->attribute('accept', '.jpeg, .jpg, .png, .gif, .mov, .mp4, .avi')->attribute('multiple', true)->style('display: none;')->required() }}
@php $fileUrl = old('file_url', ''); if (empty($fileUrl) && isset($data)) { if (is_array($data)) { $fileUrl = $data['file_url'] ?? ''; } elseif (is_object($data)) { $fileUrl = $data->file_url ?? ''; } } @endphp @if (!empty($fileUrl)) @endif
File field is required
{{ html()->submit(trans('messages.save'))->class('btn btn-md btn-primary float-right')->id('submitButton')->attribute('disabled') }}

@php $activeDisk = env('ACTIVE_STORAGE', 'local'); $folders = []; // Folders to exclude from UI $excluded = ['avatars', 'subtitles']; $formatFolder = function (string $path) { $name = basename(trim($path, '/')); $translationKey = 'folder_' . strtolower($name); if (\Lang::has('messages.' . $translationKey)) { $displayName = __('messages.' . $translationKey); } else { $displayName = ucfirst(str_replace(['-', '_'], ' ', $name)); } return [ 'name' => $name, 'display_name' => $displayName, 'path' => trim($path, '/'), ]; }; if ($activeDisk === 'local') { $root = storage_path('app/public'); if (is_dir($root)) { // Read only directories, skip dot entries, and excluded names foreach (scandir($root) as $entry) { if ($entry === '.' || $entry === '..') { continue; } if (in_array($entry, $excluded, true)) { continue; } $full = $root . '/' . $entry; if (is_dir($full)) { $folders[] = $formatFolder($entry); } } } } else { $disk = Storage::disk($activeDisk); // Root-level directories in bucket foreach ($disk->directories('') as $dir) { $dir = trim($dir, '/'); $name = basename($dir); if (in_array($name, $excluded, true)) { continue; } $folders[] = $formatFolder($dir); } } @endphp @foreach ($folders as $folder) @if ($folder['name'] != 'avatars' && $folder['name'] != 'subtitles' && $folder['name'] != 'logo')
{{ $folder['display_name'] }}
{{-- {{ $folder['name'] }} --}}
@endif @endforeach
{{--
--}}
{{ html() ->button(__('messages.save')) ->type('button') ->class('btn btn-md btn-primary mt-2') ->id('mediaSubmitButton') }}