我正在使用barryvdh/laravel-dompdf
创建我的pdf文档。我已经在控制器中创建了一个函数来创建pfd。但是现在我要保存pdf。
$myData = array('data' => $data);
if (!empty($data)){
// Send data to the view using loadView function of PDF facade
$pdf = PDF::loadView('pdf.invoice', $myData);
// If you want to store the generated pdf to the server then you can use the
store function
// Finally, you can download the file using download functio
$pdf->save(storage_path('invoices\INV'.$year.Auth::user()->lab_id.'.pdf'));
return $pdf->download('invoice.pdf');
}
但是现在我收到错误消息
file_put_contents(C:\laragon\www\WebPTS\storage\invoices\INV201846.pdf): failed to open stream: No such file or directory
请协助。
答案 0 :(得分:0)