@php preg_match( '/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w-]{11})/i', $data['youtube_url'] ?? '', $matches ); $videoId = $matches[1] ?? null; $thumbnail = $videoId ? "https://img.youtube.com/vi/{$videoId}/hqdefault.jpg" : null; $videoUrl = $data['youtube_url'] ?? '#'; @endphp @if ($videoId)
@endif