<x-header />
<div class="content-wrapper">
    <div class="content">
        @foreach($categories as $category)
        <div>
            <h2>{{$category->name}}</h2>
            <div class="movie-grid">
                @foreach($category->products as $product)
                @if($product->count != 0)
                <div class="movie-item">
                    <img src="public/{{$product->photo}}">
                    <h3>{{$product->name}}</h3>
                    <p>Цена: {{$product->price}} руб.</p>
                    <a href="{{ Route('addcart', $product->id) }}"><button>В корзину</button></a>
                </div>
                @endif
                @endforeach
            </div>
        </div>
        @endforeach
    </div>
</div>

<x-footer />
<x-scripts />