title: Fast excel exporting the file however it is not downloading - php laravel
body: <p>I am using fast-excel <a href="https://github.com/rap2hpoutre/fast-excel" rel="nofollow noreferrer">https://github.com/rap2hpoutre/fast-excel</a> to export data from laravel. My Code looks like:</p>
  
  <pre><code>public function export(Request $request,$property_id)
      {
          $reviews = Review::with(['unit','amenityValue','amenityValue.amenity','amenityValue.amenity.category','amenityValue.unitAmenityValues'])
              -&gt;where('property_id',$property_id)
              -&gt;orderBy('created_at','desc')
              -&gt;get();
          $file_name = 'review-' . time() . '.xlsx';
          $file_path = storage_path('app/public/exports/'.$file_name);
  
          (new FastExcel($reviews))-&gt;export($file_path , function ($review) {
              if ($review-&gt;status != 3) {
                  if ($review-&gt;action == 2) {
                      $count_num = (int)count($review-&gt;amenityValue-&gt;unitAmenityValues);
                      $unit_num = 'Multiple';
                  } elseif ($review-&gt;action == 5) {
                      $count_num = (int)0;
                      $unit_num = '';
                  } else {
                      $count_num = (int)1;
                      $unit_num = $review-&gt;unit-&gt;unit_number;
                  }
  
                  if ($review-&gt;status == 1) {
                      $action = 'Pending';
                  } else {
                      $action = 'Accepted';
                  }
  
                  return [
                      'Total Units' =&gt; $count_num,
                      'Unit Number' =&gt; $unit_num,
                      'Category Name' =&gt; ($review-&gt;amenityValue) ? $review-&gt;amenityValue-&gt;amenity-&gt;category-&gt;category_name : '',
                      'Amenity Name' =&gt; ($review-&gt;amenityValue) ? $review-&gt;amenityValue-&gt;amenity-&gt;amenity_name : '',
                      'New Amenity Value' =&gt; $review-&gt;new_amenity_value,
                      'Old Amenity Value' =&gt; $review-&gt;old_amenity_value,
                      'Action' =&gt; $action
                  ];
  
              }
          });
  </code></pre>
  
  <p>This works totally fine ande create an exported file on the destination folder ,however, if I changed this <code>export</code> to <code>download</code> as</p>
  
  <pre><code>(new FastExcel($reviews))-&gt;download($file_name, function ($review) { //updated filename as well
  </code></pre>
  
  <p>than this does not work. By the way it does not throws any errors nor force file to download.</p>
  
  <p><strong>Update</strong>: It looks like I was missing to return however, adding <code>return</code> returns data with some weird characters as the xhr response instead of downloading the file. Now, my code looks as shown in attached image.</p>
  
  <pre><code>return (new FastExcel($reviews))-&gt;download($file_name, function ($review) { 
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/4Pikg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4Pikg.png" alt="screenshot"></a></p>