@extends('layouts.app') @section('content') Menampilkan produk dengan kategori: {{ $cat_name }} Kategori Semua {{ $all }} @foreach ($category as $category) @if (count(App\Models\Product::with('Category')->get()->where('category_id', $category->id)->where('is_listed', 1)->where('stock', '>', 0)) > 0) {{ $category->name }} {{ count(App\Models\Product::with('Category')->get()->where('category_id', $category->id)->where('is_listed', 1)->where('stock', '>', 0)) }} @endif @endforeach {{-- {{ dd($product) }} --}} @if ($count > 8) Tampilkan Terbaru Populer Harga Terendah Harga Termahal @endif @foreach ($product as $product) Rp. {{ number_format($product->price, 0, '', '.') }} {{ $product->name }} {{ $product->Category->name }} {{-- --}} @endforeach {{ $product_pagination->links() }} @endsection @section('js') @endsection