@php use App\Models\Product; use App\Models\Calendar; $products = Product::orderBy('created_at', 'desc')->paginate(5); $todayDate = date("Y-m-d"); $day = Calendar::where('set', 1) ->where('start_date', $todayDate) ->orWhere('start_date', '>', $todayDate) ->orWhere('end_date', '<', $todayDate) ->where('end_date', $todayDate) ->first(); $inCart = session('cart') && isset(session('cart')[$product->id]); @endphp @extends('layouts.land') @section('content') @include('sweetalert::alert') @if ($otherImages && count($otherImages)) @foreach ($otherImages as $index => $img) @endforeach @endif {{ $product->name }} ₦{{ $product->price * 2 }} ₦{{ $product->price }} {{ $product->desc }} @if (!auth()->user() || (auth()->user()->role !== 'admin' && $product->trader)) Contact Seller @endif @if ($day && $product->exempt !== 1) Booking Closed @else @csrf {{ $inCart ? 'Remove from Cart' : 'Add to Cart' }} @endif @endsection
{{ $product->desc }}