title: Laravel storage path in production server
body: <p>I do have a trouble to save generated excel file in the production server, I did set the storage path in <code>/public/reports</code> directory as like below:</p>
  
  <pre><code>$filename = "report-".date('YmdHis').".xlsx";
  $storage_path = public_path('reports');
  </code></pre>
  
  <p>However, the file wouldn't be saved in <code>reports</code> folder but at the <code>public</code> folder, I've been tried </p>
  
  <pre><code>$storage_path = public_path().'\reports\\';
  </code></pre>
  
  <p>but this will save outside of the public folder.</p>
  
  <p>I'm new in laravel, I appreciate if anyone can point out what is the workaround.</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Here is the whole block:</p>
  
  <pre><code>public function handle()
  {
      $spreadsheet = new Spreadsheet();
  
      $sheet = $spreadsheet-&gt;getActiveSheet();
      $sheet-&gt;getStyle('C')-&gt;getAlignment()-&gt;setHorizontal('left');
      $sheet-&gt;getColumnDimension('A')-&gt;setWidth(8);
      $sheet-&gt;getColumnDimension('B')-&gt;setWidth(30);
      $sheet-&gt;setCellValue('A1', 'title');
      $sheet-&gt;setCellValue('B1', 'brief');
  
      $reports = Report::get();
      if(count($reports) &gt; 0) {
          $rowCount = 2;
          foreach($reports as $report) {
              $sheet-&gt;setCellValue('A' . $rowCount, $report-&gt;title);
              $sheet-&gt;setCellValue('B' . $rowCount, $report-&gt;brief);
              $rowCount++;
          }
      }
  
      $spreadsheet-&gt;getActiveSheet()-&gt;setTitle('Report Title');
      $spreadsheet-&gt;setActiveSheetIndex(0);
  
      $export_filename = "report-".date('YmdHis').".xlsx";
      \Illuminate\Support\Facades\Storage::disk('reports')-&gt;put($export_filename, $content);
  
      $writer = new Xlsx($spreadsheet);
      $writer-&gt;save($storage_path.$export_filename);
  
      Mail::to(env('RPT_RECEIVER'))-&gt;send(new ReportsMail($storage_path.$export_filename, 'Report Name', date('F')));
      exit;
  }
  </code></pre>