I am using barryvdh/laravel-dompdf to convert html page to pdf download. But I have little problem. Download process so long to loading. Here is my code. In controller
$sale = Sale::find($id);
view()->share('sale', $sale);
$pdf = PDF::loadview('sale.slip_out_pdf');
return $pdf->download('slip_out.pdf');
Routes
Route::get('pdf/{id}', 'SaleController@pdf');
view
<a href="{{ action('SaleController@pdf',[$sale->id]) }}">Download PDF</a>