@extends('layouts.meridian') @section('title', 'Media Library') @php $typeLabels = [ 'all' => 'Semua', 'image' => 'Gambar', 'pdf' => 'PDF', 'other' => 'Lainnya', ]; $formatBytes = function (?int $bytes): string { if (!$bytes) { return '0 KB'; } if ($bytes >= 1048576) { return round($bytes / 1048576, 1) . ' MB'; } return max(1, round($bytes / 1024)) . ' KB'; }; $displayName = function (string $filename): string { $name = pathinfo($filename, PATHINFO_FILENAME) ?: $filename; $name = preg_replace('/[-_]+/', ' ', $name) ?: $name; return \Illuminate\Support\Str::headline($name); }; @endphp @push('head') @endpush @section('content')
@csrf
@include('cms.partials.icon', ['name' => 'media'])

Upload Media Baru

Klik kotak ini atau seret gambar/PDF ke sini. Maksimal 5MB per file.

Mengupload file...
@include('cms.partials.icon', ['name' => 'search'])
@forelse($items as $item) @php $isImage = str_starts_with((string) $item->mimetype, 'image/'); $isPdf = $item->mimetype === 'application/pdf'; @endphp
@if($isImage) {{ $item->filename }} @else
@include('cms.partials.icon', ['name' => $isPdf ? 'file' : 'media'])
{{ $isPdf ? 'PDF' : 'FILE' }}
@endif

{{ $displayName($item->filename) }}

{{ $item->mimetype }} {{ $formatBytes($item->size) }}

{{ optional($item->createdAt)->translatedFormat('d M Y H:i') }}

@csrf @method('DELETE')
@empty
@include('cms.partials.icon', ['name' => 'media'])

Belum ada media

Upload file pertama untuk mulai mengelola aset website.

@endforelse
@endsection @push('scripts') @endpush