@extends('layouts.app') @section('title', $gallery->title . ' - Video Gallery') @section('content')
{{-- Page Header --}}

{{ $gallery->title }}

{{-- Back Button --}}
Back to Gallery
{{-- Videos Grid --}} @if($gallery->videos && count($gallery->videos) > 0)
@foreach($gallery->videos as $video) @php $youtubeId = null; // Extract YouTube video ID from various URL formats if (preg_match('/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([^&\?\/]+)/', $video['youtube_url'], $matches)) { $youtubeId = $matches[1]; } @endphp @if($youtubeId)
{{-- YouTube Embed --}}
{{-- Video Title --}}
{{ $video['title'] }}
@if(!empty($video['info']))

{{ $video['info'] }}

@endif
@endif @endforeach
@else
No videos in this gallery yet.
@endif
@endsection