@extends('site.layouts.' . $pageTemplate) @section('title', $category->name . ' | Inverted Line' ?? 'Inverted Line') @push('styles') @endpush @php function getYoutubeEmbedUrl($url) { $youtube_id = ''; $shortUrlRegex = '/youtu.be\/([a-zA-Z0-9_-]+)\??/i'; $longUrlRegex = '/youtube.com\/((?:embed)|(?:watch))((?:\?v\=)|(?:\/))([a-zA-Z0-9_-]+)/i'; if (preg_match($longUrlRegex, $url, $matches)) { $youtube_id = $matches[count($matches) - 1]; } if (preg_match($shortUrlRegex, $url, $matches)) { $youtube_id = $matches[count($matches) - 1]; } return 'https://www.youtube.com/embed/' . $youtube_id; } @endphp @section('contents')
@forelse($posts as $post)

{{ $post->title }}

@empty
No Videos Found
@endforelse
@if ($posts->hasPages())
{!! $posts->onEachSide(2)->links() !!}
@endif
@endsection