All Videos

@forelse ($videos as $video)
@php $videoId = null; if (isset($video->url)) { if (str_contains($video->url, 'v=')) { // Handle URLs like https://www.youtube.com/watch?v=VIDEO_ID $videoId = explode('v=', $video->url)[1] ?? null; // Remove any additional query parameters (e.g., &t=123) $videoId = explode('&', $videoId)[0] ?? $videoId; } elseif (str_contains($video->url, 'youtu.be')) { // Handle URLs like https://youtu.be/VIDEO_ID $videoId = explode('youtu.be/', $video->url)[1] ?? null; } } @endphp @if($videoId) @endif
@empty

No videos found.

@endforelse
{{ $videos->links('pagination::bootstrap-4') }}