title: Laravel 5.1 - barryvdh/laravel-dompdf, PDF file download not working properly
body: <p>I have installed 'barryvdh/laravel-dompdf' using composer and added these lines </p>
  
  <pre><code>Barryvdh\DomPDF\ServiceProvider::class
  'PDF'=&gt;  Barryvdh\DomPDF\Facade::class
  </code></pre>
  
  <p>to 'app.php' file in 'config' folder and also created  PdfController, like this</p>
  
  <pre><code>&lt;?php
  namespace App\Http\Controllers;
  use Illuminate\Http\Request;
  use App\Http\Requests;
  use App\Http\Controllers\Controller;
  use App;
  use PDF;
  
  class PdfController extends Controller
  {
      public function invoice()
      {
          $pdf = App::make('dompdf.wrapper');
          $pdf-&gt;loadHTML('&lt;h1&gt;Test&lt;/h1&gt;');
          return $pdf-&gt;stream('testfile')
                 -&gt;header('Content-Type','application/pdf');
      }
  }
  </code></pre>
  
  <p>now the code works fine , contents are show  in browser in pdf format, but when i download this file, the file doesn't have any extension.I tried to modify the line containing return code like</p>
  
  <pre><code>return $pdf-&gt;stream('testfile.pdf')
                     -&gt;header('Content-Type','application/pdf');
  </code></pre>
  
  <p>But now, page directly provides file to download with name 'document.pdf'
  which shows error while downloading,(dont konw how and from where this name 'document.pdf' came from).
  Also i m working on localhost. </p>