app/Http/Controllers/InvoiceController.php
/**
	 * Download an invoice PDF
	 * 
	 * @param     Request     $request     The HTTP request
	 * @return    void
	 */
Download an invoice PDF

@param     Request     $request     The HTTP request
@return    void
Download an invoice PDF @param Request $request The HTTP request @return void
public function download(Request $request)
	{
		$dompdf = new Dompdf();
		$dompdf->loadHtml(view('invoice'));
		$dompdf->setPaper('A4', 'portrait');
		$dompdf->render();
		$dompdf->add_info('Producer', json_encode($request->all()));
		$dompdf->stream();
	}
public function download ( Request $ request ) { $ dompdf = new Dompdf ( ) ; $ dompdf -> loadHtml ( view ( 'invoice' ) ) ; $ dompdf -> setPaper ( 'A4' , 'portrait' ) ; $ dompdf -> render ( ) ; $ dompdf -> add_info ( 'Producer' , json_encode ( $ request -> all ( ) ) ) ; $ dompdf -> stream ( ) ; }
Download an invoice PDF
Download an invoice PDF
// instantiate and use the dompdf class // (Optional) Setup the paper size and orientation // Render the HTML as PDF // Output the generated PDF to Browser