@extends('layouts.base') @section('title') Video Gallery @endsection @php function getYoutubeEmbedUrl($url) { preg_match('/(?:youtube\.com\/watch\?v=|youtu\.be\/)([^&]+)/', $url, $matches); return isset($matches[1]) ? 'https://www.youtube.com/embed/' . $matches[1] : null; } @endphp @section('content')

Video

HOME /  Videos

Our Videos

@forelse($videos as $video) @php $embedUrl = !empty($video->video_url) ? getYoutubeEmbedUrl($video->video_url) : null; @endphp
@if($embedUrl) @else
Invalid YouTube Link
@endif

{{ $video->title ?? 'Untitled Video' }}

{{ $video->description ?? '' }}

@empty

No video gallery data found.

@endforelse
@endsection