Advertisement
ghiwar

post.blade.php

Jan 21st, 2020
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 KB | None | 0 0
  1. @php
  2. $images = collect($images)->shuffle()->take(6)->toArray();
  3. @endphp
  4. @php
  5. $sentences = collect($sentences)->take(12)->toArray();
  6. shuffle($sentences);
  7. @endphp
  8.  
  9. @if(!empty($sentences))
  10. <p>{{ @array_pop($sentences) }} {{ @array_pop($sentences) }}</p>
  11. @endif
  12.  
  13. @foreach(collect($images)->shuffle()->chunk(3) as $chunked)
  14. @if($loop->iteration == 2)
  15. <div class="text-left">
  16. <h3>{{ @array_pop($sentences) }}</h3>
  17. <img src="{{ collect($images)->random()['url'] }}" width="34%" align="left" style="margin-right: 8px;margin-bottom: 8px;">
  18. @foreach(collect($sentences)->chunk(3) as $chunked_sentences)
  19. <p>
  20. @if($loop->first) <strong>{{ ucfirst($keyword) }}</strong>. @endif @foreach($chunked_sentences as $chunked_sentence){{ $chunked_sentence }} @endforeach
  21. </p>
  22. @endforeach
  23. </div>
  24. @endif
  25. <div class="row">
  26. @foreach($chunked as $image)
  27. <div class="column">
  28. <img class="img-fluid" src="{{ $image['url'] }}" onerror="this.onerror=null;this.src='https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQh_l3eQ5xwiPy07kGEXjmjgmBKBRB7H2mRxCGhv1tFWg5c_mWT';" style="width:100%">
  29. <p>{{ $image['title'] }}</p>
  30. </div>
  31. @endforeach
  32. </div>
  33. @endforeach
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement