SHARE
TWEET

Untitled

a guest Sep 17th, 2019 80 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <======================= Cambiar los estilos según el loop en el que se encuentre el foreach-}}==========================>
  2. {{-- Con la variable $loop de laravel podemos obtener el valor 'iteration' y con un if podemos definir la estructura del sitio según se requiera--}}
  3.  
  4. <div class="container">
  5.     <div class="row"
  6.     @foreach($items as $item)
  7.         $iteration = $loop->iteration;
  8.  
  9.         @if($iteration % 2 == 0)
  10.  
  11.         <div class="col-md-6"></div>
  12.         <div class="col-md-4"></div>
  13.         <div class="col-md-2"></div>
  14.         @else
  15.         <div class="col-md-2"></div>
  16.         <div class="col-md-6"></div>
  17.         <div class="col-md-4"></div>
  18.         @endif
  19.  
  20.     @endforeach
  21.     </div>
  22. </div>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top