@extends('layouts.admin') @section('title', 'Media Library') @section('content')
{{-- Header --}}

Media Library

Manage and organize your media assets

{{-- Stats Cards --}}

Total Files

{{ number_format($totalFiles) }}

Storage Used

@php $totalKB = $totalSize / 1024; @endphp @if($totalKB >= 1048576) {{ round($totalKB / 1024, 2) }} GB @elseif($totalKB >= 1024) {{ round($totalKB / 1024, 2) }} MB @else {{ round($totalKB, 2) }} KB @endif

Current Location

{{ $path ? basename($path) : 'Root' }}

{{-- Alerts --}} @if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif {{-- Breadcrumbs --}} @if($path) @endif {{-- Main Content Card --}}
{{-- Toolbar --}}

Media Files

{{-- Grid --}}
@php $visibleCount = 0; @endphp @foreach($paginatedItems as $item) @if($item['type'] === 'directory') @php $visibleCount++; @endphp

{{ $item['name'] }}

Folder

@else @php $visibleCount++; $ext = strtolower(pathinfo($item['name'], PATHINFO_EXTENSION)); $isImage = in_array($ext, ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg']); @endphp
@if($isImage) {{ $item['name'] }} @else
@if(in_array($ext, ['pdf'])) @elseif(in_array($ext, ['mp4', 'mov', 'avi'])) @else @endif
@endif

{{ $item['name'] }}

@php $bytes = $item['size']; @endphp @if($bytes >= 1073741824) {{ round($bytes / 1073741824, 2) }} GB @elseif($bytes >= 1048576) {{ round($bytes / 1048576, 2) }} MB @elseif($bytes >= 1024) {{ round($bytes / 1024, 2) }} KB @else {{ $bytes }} B @endif {{ $ext }}
{{ $item['modified'] ? date('M d', $item['modified']) : '-' }}
@csrf @method('DELETE')
@endif @endforeach @if($visibleCount === 0)

No media files found

Upload files to get started with your media library.

@endif
{{-- Pagination --}} @if($paginatedItems->hasPages())
{{ $paginatedItems->links() }}
@endif
{{-- Upload Modal --}} {{-- Settings Modal --}} @endsection