@extends('frontend.layouts.app') @section('content') @php $coupon = \App\Coupon::where('code', $code)->first(); if(!empty($coupon)){ foreach (json_decode(@$coupon->details) as $key => $val) { $product_id[] = $val->product_id; } if(count($product_id) > 0){ $products = \App\Product::whereIn('id', $product_id)->where('published', 1)->paginate(24); } } $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; $url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]"; $finalUrl = $url.'/offer/product/'.$coupon->code; $offerBanner = \App\Slider::where('link', $finalUrl)->where('published', 1)->first(); $mobileBanner = \App\MobileWebSlider::where('link', $finalUrl)->where('published', 1)->first(); @endphp
@if(count($data) > 0)