@if(isset($products) && count($products) > 0) @foreach ($products as $product) {{-- FRAGRANCE --}} {{-- COD --}} {{-- STOCK --}} {{-- DEAL STATUS --}} {{-- DEAL TIME LEFT --}} {{-- STATUS --}} {{-- ACTIONS --}} @endforeach @endif
Date & Time Image Product Fragrance Category Code COD Stock Deal Deal Time Left Status Action
{{ $product->created_at->format('d M Y h:i A') }} @if($product->image && Storage::exists($product->image)) @endif {{ $product->name }} @if($product->fragrance) @php $fragranceIds = is_array($product->fragrance) ? $product->fragrance : json_decode($product->fragrance, true); $fragrances = App\Models\OilGrade::whereIn('id', $fragranceIds ?? []) ->pluck('title') ->toArray(); @endphp {{ !empty($fragrances) ? implode(', ', $fragrances) : 'NA' }} @else NA @endif {{ $product->categories->name ?? '-' }} {{ $product->product_code }} @if($product->has_cash_on_delivery) Yes @else No @endif @if($product->stock == 0) Out @else Available @endif @if($product->is_deal_active) Active @elseif($product->is_deal) Expired @else No @endif @if($product->is_deal_active && $product->deal_end) {{ $product->deal_time_left_human }} @else - @endif @if($product->status == "active") Active @else Inactive @endif