Fixes for paths to s3 type storage

This commit is contained in:
David Bomba 2021-04-06 22:36:50 +10:00
parent 6da6388371
commit 161f20fae7
4 changed files with 8 additions and 3 deletions

View File

@ -795,8 +795,6 @@ class InvoiceController extends BaseController
$file_path = $invoice->service()->getInvoicePdf($contact);
nlog($file_path);
return response()->download($file_path, basename($file_path));
}

View File

@ -100,7 +100,6 @@ class Company extends BaseModel
'country_id' => 'string',
'custom_fields' => 'object',
'settings' => 'object',
'custom_fields' => 'object',
'updated_at' => 'timestamp',
'created_at' => 'timestamp',
'deleted_at' => 'timestamp',

View File

@ -13,6 +13,7 @@ namespace App\Services\Credit;
use App\Jobs\Entity\CreateEntityPdf;
use App\Services\AbstractService;
use App\Utils\TempFile;
use Illuminate\Support\Facades\Storage;
class GetCreditPdf extends AbstractService
@ -48,6 +49,9 @@ class GetCreditPdf extends AbstractService
$file_path = CreateEntityPdf::dispatchNow($this->invitation);
}
if(config('filesystems.default') == 's3')
return TempFile::path(Storage::disk($disk)->url($file_path));
return Storage::disk($disk)->path($file_path);
}
}

View File

@ -15,6 +15,7 @@ use App\Jobs\Entity\CreateEntityPdf;
use App\Models\ClientContact;
use App\Models\Quote;
use App\Services\AbstractService;
use App\Utils\TempFile;
use Illuminate\Support\Facades\Storage;
class GetQuotePdf extends AbstractService
@ -46,6 +47,9 @@ class GetQuotePdf extends AbstractService
$file_path = CreateEntityPdf::dispatchNow($invitation);
}
if(config('filesystems.default') == 's3')
return TempFile::path(Storage::disk($disk)->url($file_path));
return Storage::disk($disk)->path($file_path);
}
}