@extends('admin.layouts.app') @section('title', 'Edit Galeri') @section('content')

Edit Galeri

Kembali
@csrf @method('PUT')
@error('title')
{{ $message }}
@enderror
@php $media = $gallery->image ?? $gallery->video; $ext = strtolower(pathinfo($media, PATHINFO_EXTENSION)); $isImage = in_array($ext, ['jpg','jpeg','png','gif','webp']); $isVideo = in_array($ext, ['mp4','mov','avi','mkv','webm']); // Fix untuk path video yang tidak lengkap $videoPath = $gallery->video; if ($videoPath && !str_contains($videoPath, '/')) { $videoPath = 'galleries/videos/' . $videoPath; } $imagePath = $gallery->image; if ($imagePath && !str_contains($imagePath, '/')) { $imagePath = 'galleries/images/' . $imagePath; } @endphp
@if ($isImage && $gallery->image) {{ $gallery->title }} @elseif ($isVideo && $gallery->video) @else
@endif
@if($isVideo) Video @elseif($isImage) Foto @endif
Format: JPG, PNG, GIF. Max 2MB @error('image')
{{ $message }}
@enderror {{-- Preview gambar baru --}}
Format: MP4, AVI, MOV. Max 50MB @error('video')
{{ $message }}
@enderror {{-- Preview video baru --}}
Catatan: Jika Anda upload gambar/video baru, media lama akan otomatis terhapus.
Batal
@endsection