title: Laravel collection .each() + array_push
body: <p>need help regarding array_push inside .each() method on laravel. I cannot get the container array on this code:</p>
  
  <pre><code>$imagesData = array();
  collect($data['images'])-&gt;each(function($v, $k) use($imagesData){
  
      $v['created_at'] = date('Y-m-d H:i:s');
      $v['updated_at'] = date('Y-m-d H:i:s');
      $v['image_id'] = $v['image_id'];
      $v['settings'] = json_encode($v['settings']);
  
      array_push($imagesData, $v);
  
  });
  
  $result = Images::insert($imagesData, true);
  </code></pre>
  
  <p>Basically, the code above I want to iterate the data inside .each() and then push it to array container and insert it by batch.
  NOTE: when i use foreach there will be no problem, but I need to use .each() instead of foreach.</p>
  
  <p>Thanks</p>