title: Random using shuffle on laravel blade make unique
body: <p>I'm having a problem. </p>
  
  <p>I have this code:</p>
  
  <pre><code>  &lt;?php $q =(count($question-&gt;answers)/2) - 1;  ?&gt;
      @php ($q = 3)
  
      @php ($p = 1)
      @for($i=0; $i &lt;=(count($question-&gt;answers)/2) - 1; $i++) 
  
          &lt;?php 
  
          $match = $question-&gt;answers-&gt;where('is_key', 0)-&gt;shuffle()-&gt;toArray();  
  
          $match = $match-&gt;unique();
          dd($match['text']);
  
          ?&gt;
  
          &lt;?php $option = $question-&gt;answers-&gt;where('order', $i)-&gt;where('is_key', 1)-&gt;first(); ?&gt;
  
  
      &lt;div class="row"&gt;
          &lt;div class="column" style="border: 1px solid  #e8e8e8;"&gt;
              &lt;b&gt;{{$p}}.&lt;/b&gt; {{$match['text']}} 
          &lt;/div&gt;
  
          &lt;div class="column" style="border: 1px solid #e8e8e8;"&gt;
              &lt;b&gt; {{$p}}. &lt;/b&gt;   {{$option-&gt;text}} 
          &lt;/div&gt;
  
      &lt;/div&gt;
  
      @php ($p++)
      @endfor
  </code></pre>
  
  <p>So I have these two columns <code>options</code> and <code>match</code>. </p>
  
  <p>What I need is the match group to be shuffled. </p>
  
  <p>I have tried this so far but when it shuffles sometimes it repeats the same text and some text does not show at all. </p>
  
  <p>E.g.:</p>
  
  <p>When <code>1 2 3 4</code> is shuffled it looks like <code>1 2 1 4</code> or <code>1 2 3 3</code>. </p>
  
  <p><strong>How do I make the digits unique when shuffled?</strong></p>