@extends('backEnd.layouts.master') @section('title', 'Media Library') @section('content')

Media Library

Manage all uploaded images and files
@php $uploadPath = public_path('storage/uploads'); $files = []; if (is_dir($uploadPath)) { $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($uploadPath)); foreach ($iterator as $file) { if ($file->isFile() && in_array(strtolower($file->getExtension()), ['jpg','jpeg','png','gif','webp','svg'])) { $files[] = [ 'path' => 'storage/uploads/' . str_replace($uploadPath . DIRECTORY_SEPARATOR, '', $file->getPathname()), 'name' => $file->getFilename(), 'size' => round($file->getSize() / 1024, 1), 'time' => $file->getMTime(), ]; } } usort($files, fn($a,$b) => $b['time'] - $a['time']); } @endphp {{-- Stats --}}
{{ count($files) }}
Total Files
{{ count(array_filter($files, fn($f) => in_array(pathinfo($f['name'], PATHINFO_EXTENSION), ['jpg','jpeg','png','gif','webp']))) }}
Images
{{ number_format(array_sum(array_column($files, 'size')) / 1024, 1) }} MB
Total Size
{{ count(array_filter($files, fn($f) => date('Y-m-d', $f['time']) === date('Y-m-d'))) }}
Uploaded Today
{{-- Filter --}}
{{-- Media Grid --}}
@if(empty($files))
No media files found

Upload images via product/banner/settings pages, or use the upload button above.

@else
@foreach($files as $file)
{{ $file['name'] }}
{{ $file['name'] }}
{{ $file['size'] }} KB
@endforeach
@endif
{{-- Image preview modal --}} @endsection @push('scripts') @endpush