I am dynamically generating a PDF with DOMPDF in Laravel and I have to save the document to Amazon's Cloud service.
I am unable to save the document to the cloud. But I can only save locally.
$pdf = PDF::loadView('contract.contract-pdf', $ data);
$pdf->save('contract.pdf');
$s3 =\Storage::disk('s3');
$s3->put('pdf/contract', new File('contract.pdf'), 'public');
How to send it to cloud?
you can do like that
put pdf output(content) on storage
$pdf = PDF::loadView('contract.contract-pdf', $data);
\Storage::disk('s3')->put('pdf/contract.pdf', $pdf->output(), 'public');