Try / Catch on delete PDF

This commit is contained in:
David Bomba 2021-12-30 08:10:24 +11:00
parent e489cf6cb9
commit 39b99c4d78

View File

@ -331,12 +331,19 @@ class InvoiceService
$this->invoice->invitations->each(function ($invitation){
try{
Storage::disk(config('filesystems.default'))->delete($this->invoice->client->invoice_filepath($invitation) . $this->invoice->numberFormatter().'.pdf');
if(Ninja::isHosted()) {
Storage::disk('public')->delete($this->invoice->client->invoice_filepath($invitation) . $this->invoice->numberFormatter().'.pdf');
}
}catch(\Exception $e){
nlog($e->getMessage());
}
});
return $this;