Advertisement
ghiwar

post.blade.php

Apr 21st, 2020
609
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.84 KB | None | 0 0
  1. @php
  2.     $images = collect($images)->shuffle()->take(0)->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="{{ str_replace(array('https://' , 'http://') , 'https://i0.wp.com/', 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.     @endforeach
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement