Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. @foreach($cards as $card)
  2. <div class="col-4">
  3. <div class="card x-auto @if($card->background) card-w-bg @endif">
  4. {{ $card->title }}
  5. {{ $card->description }}
  6. </div>
  7. </div>
  8. @endforeach
  9.  
  10. <div class="@if($loop->even) card-w-bg @endif">
  11.  
  12. @php
  13. $data = [
  14. [
  15. 'title' => 'title',
  16. 'img' => 'img.png',
  17. 'text' => 'some description',
  18. 'is_background' => true
  19. ],
  20. [
  21. 'title' => 'title',
  22. 'img' => 'img.png',
  23. 'text' => 'some description',
  24. 'is_background' => false
  25. ]
  26. ];
  27. @endphp
  28.  
  29. @foreach($data as $datum)
  30. <div class="col-4">
  31. <div class="card mx-auto {{!empty($datum['is_background']) ? 'card-w-bg' : ''}}">
  32. <img class="card-img-top mx-auto" src="{{$datum['img']}}" alt="">
  33. <div class="card-body">
  34. <h5 class="card-title">{{$datum['title']}}</h5>
  35. <p class="card-text">{{$datum['text']}}</p>
  36. <h3></h3>
  37. </div>
  38. </div>
  39. </div>
  40. @endforeach
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement