@php $kindLabels = $kindLabels ?? []; $simpleMedia = $simpleMedia ?? false; $visibleFields = $visibleFields ?? ($simpleMedia ? ['title', 'status', 'description'] : ['kind', 'title', 'subtitle', 'status', 'description', 'video']); $singleKind = count($mediaKinds) === 1 ? $mediaKinds[0] : null; $sectionLabel = $sectionLabel ?? 'Project Media'; $videoOnly = $videoOnly ?? false; $addRowOnly = $addRowOnly ?? false; $addRowLabel = $addRowLabel ?? 'Add Item'; $fieldPlaceholders = array_merge([ 'title' => 'Title', 'subtitle' => 'Subtitle', 'description' => 'Description', 'video' => 'Video URL', ], $fieldPlaceholders ?? []); $descriptionEditor = $descriptionEditor ?? false; $hideRemove = $hideRemove ?? false; $dualImage = $dualImage ?? false; $sortable = $sortable ?? false; $show = fn ($field) => in_array($field, $visibleFields, true); $rowClass = trim(($dualImage ? 'dual-thumbs' : '') . ($sortable ? ' has-drag' : '') . ($videoOnly ? ' video-only' : '')); @endphp {{-- Field values are collected into media_json on submit (avoids PHP max_input_vars truncation). --}}
{{ $sectionLabel }}@if($sortable) — drag ⋮⋮ to reorder@endif
@if($videoOnly || $addRowOnly) @else @endif
@foreach($media as $row)
@if($sortable) ⋮⋮ @endif @unless($videoOnly)
@if(!empty($row->image))@endif
@if($dualImage)
@if(!empty($row->mobile_image))@endif
@endif @endunless
@if($singleKind) @elseif($show('kind')) @else @endif @if($show('title')) @else @endif @if($show('subtitle')) @else @endif @if($show('description')) @else @endif @if($show('video')) @else @endif
@unless($hideRemove)
@endunless
@endforeach @if($media->isEmpty())
{{ ($videoOnly || $addRowOnly) ? ('No items yet — click '.$addRowLabel.'.') : 'Upload an image to add an item.' }}
@endif