using Dompdf to store data in a pdf file:
This function works fine:
$pdf = \App::make('dompdf.wrapper');
$pdf->loadHTML('<h1>Test</h1> ');
return $pdf->stream();
Now when try
$pdf = \App::make('dompdf.wrapper');
$pdf->loadHTML('<h1>Test</h1> ');
file_put_contents("test.pdf", $pdf->output());
Get error:
file_put_contents(test.pdf): failed to open stream: Permission denied
Do I need to create an additional folder to save the file or something else?
Tnx, p
source
share