
@extends('frontend.layouts.navBar')

@section('content')




    <div class="page">

  <!-- Section Shop-->
  <section class="section section-xxl bg-default text-md-left">
    <div class="container">
      <div class="row row-50">
        
              </div>

              
        <div class="">
          
          <div class="row row-30 row-lg-50">
            @foreach ($promotions as $promotion)
                
            @if($promotion->produit_id !=null)
            <div class="col-sm-6 col-md-4 col-lg-6 col-xl-4">
              <!-- Product-->
              <article class="product">
                <div class="product-body">
                  <div class="product-figure"><img src="{{ asset('storage/image/'.$promotion->produits->image) }}" alt="" width="220" height="160"/>
                     </div>
                  <h5 class="transform-none product-title"><a href="">{{$promotion->titre}}</a></h5>
                <span class="product-badge product-badge-sale">{{$promotion->remise}}</span>
                  {{-- <div class="product-price-wrap">
                 
                  </div> --}}
                </div>
                
                {{-- <span class=""></span> --}}
                <div class="product-button-wrap mt-4">
                  
                  <div class="product-button"><a class="button button-secondary button-zakaria " href="{{route('produit.show', ['id'=> $promotion->produit_id])}}"><i class="fa-solid fa-plus" style="color: grey; text-align:center"></i></a></div>
               
                </div>
              </article>
            </div>
               @else
            <div class="col-sm-6 col-md-4 col-lg-6 col-xl-4">
              <!-- Product-->
              <article class="product">
                <div class="product-body">
                  <div class="product-figure"><img src="{{ asset('storage/image/'.$promotion->photo) }}" alt="" width="220" height="160"/>
                     </div>
                  <h5 class="transform-none product-title"><a href="{{route('promotion.show', ['id'=> $promotion])}}">{{$promotion->titre}}</a></h5>
              
                  {{-- <div class="product-price-wrap">
                 
                  </div> --}}
                </div>
                
                {{-- <span class=""></span> --}}
                <div class="product-button-wrap mt-4">
                  <div class="product-button"><a class="button button-secondary button-zakaria " href="{{route('promo.show', ['id'=> $promotion])}}"><i class="fa-solid fa-plus" style="color: grey; text-align:center"></i></a></div>
                 
                </div>
              </article>
            </div>
            @endif


            @endforeach
           
            
           
           
          </div>
          <div class="pagination-wrap">
            <!-- Bootstrap Pagination-->
            {!! $promotions->links()!!}
          </div>
        </div>
      </div>
    </div>
  </section>
</div>

@endsection