title: Laravel merge arrays inside an array
body: <p>I have such result</p>
  <pre><code>array:2 [
    0 =&gt; array:5 [
      0 =&gt; 3
      1 =&gt; 7
      2 =&gt; 8
      3 =&gt; 9
      4 =&gt; 10
    ]
    1 =&gt; array:1 [
      0 =&gt; 216
    ]
  ]
  </code></pre>
  <p>And I want to have it like this:</p>
  <pre><code>array:6 [
      0 =&gt; 3
      1 =&gt; 7
      2 =&gt; 8
      3 =&gt; 9
      4 =&gt; 10
      5 =&gt; 216
  ]
  </code></pre>
  <p><strong>How should I change my code?</strong></p>
  <pre><code>$barcodes = [];
  foreach($request-&gt;input('serials') as $serial)
  {
      if(!empty($serial['barcode_id'])) {
          if($serial['amount'] &gt; 1) {
              $barcodes[] = Barcode::where('sold', true)-&gt;take($serial['amount'])-&gt;pluck('id')-&gt;toArray(); // returned `0 =&gt; array:5 [`
          } else {
              $barcodes[] = Barcode::where('sold', true)-&gt;where('serial_number', $serial['barcode_id'])-&gt;orWhere('u_serial_number', $serial['barcode_id'])-&gt;pluck('id')-&gt;toArray(); // returned `1 =&gt; array:1 [`
          }
      }
  }
  dd($barcodes);
  </code></pre>