title: laravel download response filename not changing
body: <p>I am using laravel and trying to download a file and change the filename.
  The documentation tells me that I can use the second argument as the new filename, but the filename won't change to "testdownload.zip" somehow. What am I doing wrong?</p>
  
  <p><a href="https://laravel.com/docs/5.8/responses#file-downloads" rel="nofollow noreferrer">https://laravel.com/docs/5.8/responses#file-downloads</a></p>
  
  <pre><code>    // routes
      Route::group(['middleware' =&gt; ['web']], function()
      {
          Route::group(['namespace' =&gt; 'App\Http\Controllers'], function()
          {
              Route::group(['middleware' =&gt; ['role:root|admin|store|user']], 
  function()
              {
                  // download purchase
                  Route::get('dashboard/order/downloadfile', [
                      'as'    =&gt; 'order-download',
                      'uses'  =&gt; 'Post\PostController@download'
                  ]);
              });
          }
      }
  
      // method in Controller
      public function download(Request $request)
      {
          return response()-&gt;download(storage_path('app/lorem-ipsum-shop-1.zip'), 'testdownload.zip', ['Content-Type: application/zip']);
      }
  </code></pre>
  
  <p>When I do dd(response()->download(storage_path('app/lorem-ipsum-shop-1.zip'), 'testdownload.zip', ['Content-Type: application/zip'])) the following is returned (could it be the perms / permissions 0100666? I am on Windows):</p>
  
  <pre><code>BinaryFileResponse {#449 ▼
    #file: File {#464 ▼
      path: "C:\xampp71\htdocs\storage\app"
      filename: "lorem-ipsum-shop-1.zip"
      basename: "lorem-ipsum-shop-1.zip"
      pathname: "C:\xampp71\htdocs\storage\app/lorem-ipsum-shop-1.zip"
      extension: "zip"
      realPath: "C:\xampp71\htdocs\storage\app\lorem-ipsum-shop-1.zip"
      aTime: 2019-11-14 11:34:52
      mTime: 2019-11-14 11:34:52
      cTime: 2019-11-01 16:05:10
      inode: 0
      size: 24626
      perms: 0100666
      owner: 0
      group: 0
      type: "file"
      writable: true
      readable: true
      executable: false
      file: true
      dir: false
      link: false
      linkTarget: "C:\xampp71\htdocs\storage\app\lorem-ipsum-shop-1.zip"
    }
    #offset: 0
    #maxlen: -1
    #deleteFileAfterSend: false
    +headers: ResponseHeaderBag {#234 ▼
      #computedCacheControl: array:1 [▼
        "public" =&gt; true
      ]
      #cookies: []
      #headerNames: array:5 [▼
        0 =&gt; 0
        "cache-control" =&gt; "Cache-Control"
        "date" =&gt; "Date"
        "last-modified" =&gt; "Last-Modified"
        "content-disposition" =&gt; "Content-Disposition"
      ]
      #headers: array:5 [▼
        0 =&gt; array:1 [▶]
        "cache-control" =&gt; array:1 [▶]
        "date" =&gt; array:1 [▶]
        "last-modified" =&gt; array:1 [▶]
        "content-disposition" =&gt; array:1 [▼
          0 =&gt; "attachment; filename=testdownload.zip"
        ]
      ]
      #cacheControl: array:1 [▼
        "public" =&gt; true
      ]
    }
    #content: null
    #version: "1.0"
    #statusCode: 200
    #statusText: "OK"
    #charset: null
  }
  </code></pre>