file_put_contents(xxx.pdf):无法打开流:没有这样的文件或目录”

file_put_contents(xxx.pdf): failed to open stream: No such file or directory"

我正在使用 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

请协助。

我设法获得了一个文档来将这些文件加载​​到 Dropbox 上。 https://itsolutionstuff.com/post/laravel-5-dropbox-api-file-upload-example-using-league-flysystem-dropbox-packageexample.html