From 2f4e129cf02763182a1b5b220f87a49ba8abb766 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 22 Oct 2022 08:19:35 +1100 Subject: [PATCH] Remove make dir for Storage:: --- app/Jobs/Entity/CreateEntityPdf.php | 6 +++--- app/Jobs/Vendor/CreatePurchaseOrderPdf.php | 4 ++-- app/Models/Backup.php | 2 +- app/Repositories/ActivityRepository.php | 3 ++- app/Services/Invoice/GenerateDeliveryNote.php | 7 ++++--- 5 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/Jobs/Entity/CreateEntityPdf.php b/app/Jobs/Entity/CreateEntityPdf.php index 68988da98432..e414a89cce48 100644 --- a/app/Jobs/Entity/CreateEntityPdf.php +++ b/app/Jobs/Entity/CreateEntityPdf.php @@ -213,9 +213,9 @@ class CreateEntityPdf implements ShouldQueue if ($pdf) { try { - if (! Storage::disk($this->disk)->exists($path)) { - Storage::disk($this->disk)->makeDirectory($path, 0775); - } + // if (! Storage::disk($this->disk)->exists($path)) { + // Storage::disk($this->disk)->makeDirectory($path, 0775); + // } Storage::disk($this->disk)->put($file_path, $pdf, 'public'); } catch (\Exception $e) { diff --git a/app/Jobs/Vendor/CreatePurchaseOrderPdf.php b/app/Jobs/Vendor/CreatePurchaseOrderPdf.php index d11f62e64f0e..4703ef1b84a5 100644 --- a/app/Jobs/Vendor/CreatePurchaseOrderPdf.php +++ b/app/Jobs/Vendor/CreatePurchaseOrderPdf.php @@ -100,8 +100,8 @@ class CreatePurchaseOrderPdf implements ShouldQueue try{ - if(!Storage::disk($this->disk)->exists($this->path)) - Storage::disk($this->disk)->makeDirectory($this->path, 0775); + // if(!Storage::disk($this->disk)->exists($this->path)) + // Storage::disk($this->disk)->makeDirectory($this->path, 0775); Storage::disk($this->disk)->put($this->file_path, $pdf, 'public'); diff --git a/app/Models/Backup.php b/app/Models/Backup.php index 2ddc96a685ae..c7d0e8f7a448 100644 --- a/app/Models/Backup.php +++ b/app/Models/Backup.php @@ -36,7 +36,7 @@ class Backup extends BaseModel $filename = now()->format('Y_m_d').'_'.md5(time()).'.html'; $file_path = $path.$filename; - Storage::disk(config('filesystems.default'))->makeDirectory($path, 0775); + // Storage::disk(config('filesystems.default'))->makeDirectory($path, 0775); Storage::disk(config('filesystems.default'))->put($file_path, $html); diff --git a/app/Repositories/ActivityRepository.php b/app/Repositories/ActivityRepository.php index f636d21413fa..ede380720b91 100644 --- a/app/Repositories/ActivityRepository.php +++ b/app/Repositories/ActivityRepository.php @@ -82,7 +82,8 @@ class ActivityRepository extends BaseRepository $backup = new Backup(); $entity->load('client'); $contact = $entity->client->primary_contact()->first(); - $backup->html_backup = $this->generateHtml($entity); + $backup->html_backup = ''; + // $backup->html_backup = $this->generateHtml($entity); $backup->amount = $entity->amount; $backup->activity_id = $activity->id; $backup->json_backup = ''; diff --git a/app/Services/Invoice/GenerateDeliveryNote.php b/app/Services/Invoice/GenerateDeliveryNote.php index 6357049122b3..828aebf612b5 100644 --- a/app/Services/Invoice/GenerateDeliveryNote.php +++ b/app/Services/Invoice/GenerateDeliveryNote.php @@ -105,9 +105,10 @@ class GenerateDeliveryNote info($maker->getCompiledHTML()); } - if (! Storage::disk($this->disk)->exists($this->invoice->client->invoice_filepath($invitation))) { - Storage::disk($this->disk)->makeDirectory($this->invoice->client->invoice_filepath($invitation), 0775); - } + // if (! Storage::disk($this->disk)->exists($this->invoice->client->invoice_filepath($invitation))) { + // Storage::disk($this->disk)->makeDirectory($this->invoice->client->invoice_filepath($invitation), 0775); + // } + Storage::disk($this->disk)->put($file_path, $pdf, 'public'); return $file_path;