@extends('layouts.backend.master') @section('admin')
{{-- Add Modal (empty $data object) --}} @include('backend.modal.gallery', ['data' => new \App\Models\Gallery()])

{{ $subTitle }}

@foreach ($dataList as $data) {{-- Media preview — use accessor (already decoded object) --}} {{-- Edit Modal for this row --}} @include('backend.modal.gallery', ['data' => $data]) @endforeach
Sl: Media Title Category Type Status Action
{{ $loop->index + 1 }} @php $file = $data->image; @endphp @if($data->type === 'youtube' && isset($file->video_id)) @elseif($file && isset($file->original)) @if($data->type === 'video') @else @endif @else @endif {{ $data->title ?? '—' }} {{ $data->category ?? '—' }} @if($data->type === 'youtube') YouTube @elseif($data->type === 'video') Video @else Photo @endif @if($data->status === 'active') Active @else Inactive @endif Edit
@csrf @method('DELETE')
@endsection