@extends('adminlte::page') @section('title', __('adminlte.file_manager')) @section('content_header')

{{ __('adminlte.file_manager') }}

@stop @section('content') @if (session('status')) {{ session('status') }} @endif @php $iconFor = function (string $name): array { $ext = strtolower(pathinfo($name, PATHINFO_EXTENSION)); return match (true) { in_array($ext, ['pdf']) => ['bi-file-earmark-pdf-fill', 'text-danger'], in_array($ext, ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg', 'avif', 'bmp']) => ['bi-file-earmark-image-fill', 'text-primary'], in_array($ext, ['doc', 'docx']) => ['bi-file-earmark-word-fill', 'text-info'], in_array($ext, ['xls', 'xlsx', 'csv']) => ['bi-file-earmark-spreadsheet-fill', 'text-success'], in_array($ext, ['ppt', 'pptx']) => ['bi-file-earmark-slides-fill', 'text-warning'], in_array($ext, ['zip', 'rar', 'gz', '7z', 'tar']) => ['bi-file-earmark-zip-fill', 'text-secondary'], in_array($ext, ['js', 'ts', 'tsx', 'jsx', 'php', 'html', 'css', 'json', 'xml', 'vue', 'py', 'rb']) => ['bi-file-earmark-code-fill', 'text-primary'], in_array($ext, ['mp3', 'wav', 'ogg', 'flac']) => ['bi-file-earmark-music-fill', 'text-purple'], in_array($ext, ['mp4', 'mov', 'avi', 'mkv', 'webm']) => ['bi-file-earmark-play-fill', 'text-danger'], in_array($ext, ['txt', 'md']) => ['bi-file-earmark-text-fill', 'text-secondary'], default => ['bi-file-earmark-fill', 'text-secondary'], }; }; $totalItems = $directories->count() + $files->count(); @endphp
{{-- Sidebar: quick links + upload --}}
@csrf
{{ __('adminlte.home') }} @foreach ($directories as $dir) {{ basename($dir) }} @endforeach

{{ __('adminlte.file_manager') }}

{{ trans_choice('{0}No items|{1}1 item|[2,*]:count items', $totalItems, ['count' => $totalItems]) }}
{{-- Main: file browser --}}
@if ($totalItems === 0)
{{ __('adminlte.no_files') }}
@else
{{-- Folders --}} @foreach ($directories as $dir) @endforeach {{-- Files --}} @foreach ($files as $file) @php([$icon, $iconColor] = $iconFor($file['name']))

{{ $file['name'] }}

@endforeach
@endif
@stop