@if(isset($slug)) @php if(isset($_GET['country'])){ $countryCode = $_GET['country']; } elseif(isset($_COOKIE['country'])){ $countryCode = $_COOKIE['country']; } else{ $countryCode = 'KE'; } $countryId = NULL; if($countryCode!=NULL){ $country = App\Models\Country::where('country_code',$countryCode)->first(); $countryId = $country->id; } @endphp @php $videos = \app\Models\Video::getVideosByCategorySlug($slug, $countryId); @endphp @php $title = \app\Models\Category::getCategoryNameBySlug($slug) @endphp @php $category_array = []; if($countryCode){ $country = App\Models\Country::where('country_code',$countryCode)->first(); $countryId = $country->id; } if($countryId!=NULL) { $video_data = \app\Models\Video::with('categories')->where('country_id',$countryId)->orWhere('country_id', '=', NULL)->get(); foreach($video_data as $video) { foreach($video->categories as $category) { if(!in_array($category->name, $category_array)) { array_push($category_array, $category->name); } } } } @endphp @if(isset($videos) && count($videos) > 0)
@if($countryId!=NULL) @if(in_array($title, $category_array))
{{$title}}
@endif @else
{{$title}}
@endif
@foreach($videos as $item)
{{-- Mobile layout --}}
{{$item->title}}
{{Str::words($item->sub_title,6)}}
@if(isset($item->getRating->image))
@endif @if(isset($item->ppv_listing_type)) @if($item->ppv_listing_type == 'Free View')
Free View
@elseif($item->ppv_listing_type == 'Pay Per View')
Pay Per View
@endif @endif
{{-- Mobile layout --}}
@endforeach
@endif @endif