mkhleel
2/15/2017 - 6:38 AM

loop two item in one row

loop two item in one row

<?php $c = 0; ?>

@foreach($products as $product)

  <?php $b = ( ++$c % 2 == 0 ) ? true : false; ?>
  
  @if($b)
    <div class="row ">
  @endif
      <div class="col-xs-12 col-sm-6 service_2i">
          <figure><img src="{{ url('/uploads') . '/' . $product->photo }}" alt="services" /></figure>
          <div class="service-two_content">
              <h6>{{ $product->name }}</h6>
              <p>{{ $product->content }}
              </p>
              <a href="{{url('/contact')}}" class="btn trans-btn service-btn ">إتصل بنا</a>
          </div>
      </div>  

  @if($b)
    </div>
  @endif

@endforeach