title: Html to pdf download in laravel 5
body: <p>I am usin barryvdh/laravel-dompdf to convert html page to pdf download.
  But I have little problem. here is my code.
  I would like to download in "show" as /sale/{id}.
  In controller</p>
  
  <pre><code> public function pdf(Request $request,$id)
  {
      $sale = Sale::find($id);
      view()-&gt;share('sale', $sale);
      if ($request-&gt;has('download')) {
          $pdf = PDF::loadview('sale.slip_out_show');
          $pdf-&gt;stream();
          return $pdf-&gt;download('saleslip_out.pdf');
      }
      return view('sale.slip_out_show');
  }
  </code></pre>
  
  <p>in view </p>
  
  <pre><code>&lt;a href="{{ route('pdf',['download'=&gt;'pdf']) }}"&gt;Download PDF&lt;/a&gt;
  </code></pre>
  
  <p>In routes</p>
  
  <pre><code>Route::get('pdf', array('as' =&gt; 'pdf', 'uses' =&gt; 'SaleController@pdf'));
  </code></pre>
  
  <p>but this error found <br>
  <strong>ErrorException in SaleController.php line 105:
  Missing argument 2 for App\Http\Controllers\SaleController::pdf()</strong></p>