@php $cats = \App\Models\Cat::where('is_visible', true) ->with([ 'products' => function ($query) { $query->where('is_visible', true)->with('images'); }, ]) ->orderBy('order_cat') ->get(); $settings = \App\Models\Setting::first(); $watermarkUrl = $settings->watermark_image ? config('app.asset_url')."/storage/".$settings->watermark_image : null; @endphp
@foreach ($cats as $cat) @if ($cat->products->count() > 0)

{{ $cat->name }}

@if ($cat->description)

{!! $cat->description !!}

@endif
@foreach ($cat->products as $product) @endforeach
@endif @endforeach