title: return an array inside chunk laravel
body: <p>i wish you can help me.</p>
  
  <p>I have the following code, outside of $export I want to return the value inside the $Paymentexport array, when I look at the browser console, it throws me the array as empty.</p>
  
  <pre><code>    $Paymentexport = [];    
      $export = Excel::filter('chunk')-&gt;load($path)-&gt;chunk(250, function ($results) use (&amp;$Paymentexport){
        foreach($results as $payment){
          // code to import Excel in to DB
          $Paymentexport[] = [
            'hi' =&gt; 'hi'
            // I'm trying to push data to this array
          ];
        }
      });
      return $Paymentexport;
  </code></pre>