@extends('layouts.frontend') @php $site_name = App\Models\WebSetting::where('key', 'site_name')->first(); @endphp @section('title', $site_name ? $site_name->value : 'Home - XTube') @section('content') @include('components.banner', [ 'type' => 'banner_rectangle_small', 'class' => 'mb-6 flex w-full justify-center justify-center', ]) @if ($shortVideos->count() > 0)

Shorts

@foreach ($shortVideos as $short)
@if ($short->thumbnail) {{ $short->title }} @else
@endif
{{ $short->formatted_duration }}

{{ $short->title }}

{{ $short->formatted_views }} views

@endforeach
@endif @include('components.banner', [ 'type' => 'banner_header_sticky', 'class' => 'my-6 flex w-full justify-center justify-center', ])
@if ($selectedCategory) @php $category = $categories->firstWhere('id', $selectedCategory); @endphp

{{ $category ? $category->name : 'Videos' }}

Show All
@endif
@if ($videos->count() > 0)
@foreach ($videos as $index => $video)
@if ($video->thumbnail) {{ $video->title }} @else
@endif
{{ $video->formatted_duration }}

{{ $video->title }}

{{ $video->formatted_views }} views {{ $video->published_at->diffForHumans() }}
{{ $video->category->name }}
{{-- Insert Rectangle Banner after every 6 videos --}} @if (($index + 1) % 6 === 0)
@include('components.banner', [ 'type' => 'banner_rectangle_small', 'class' => 'w-full', ])
@endif @endforeach
@include('components.banner', ['type' => 'banner_native_2', 'class' => 'flex justify-center'])
{{ $videos->links() }}
@else

No videos found

Try selecting a different category or check back later.

@endif @include('components.banner', ['type' => 'banner_native_1', 'class' => 'mb-6 flex justify-center']) @endsection