i have followed this example laravel-4-create-pdf-use-dompdf:
i want to save pdf in directory not pdf preview in the browser.
My current code:
$pdf = \App::make('dompdf');
$pdf->loadHTML('<h1>Hello World!!</h1>');
return $pdf->stream("order_email.pdf");
but what this code is doing, it shows my "Hello World" text as PDF in the browser but not saving "order_email.pdf" anywhere in my working directory.
Dompdf's
stream()
method always sends to the browser. If you want to capture the output and save to a file you should use theoutput()
method instead.