Advertisement
Guest User

post.blade.php

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