Force public access to PDFs

This commit is contained in:
David Bomba 2022-01-04 12:52:17 +11:00
parent b6f382bae2
commit 538ea20437
2 changed files with 6 additions and 8 deletions

View File

@ -13,6 +13,7 @@
namespace App\Jobs\Entity;
use App\Exceptions\FilePermissionsFailure;
use App\Libraries\MultiDB;
use App\Models\Account;
use App\Models\Credit;
use App\Models\CreditInvitation;
@ -101,8 +102,7 @@ class CreateEntityPdf implements ShouldQueue
public function handle()
{
$start = microtime(true);
// nlog("Start ". $start);
MultiDB::setDb($this->company->db);
/* Forget the singleton*/
App::forgetInstance('translator');
@ -204,9 +204,9 @@ class CreateEntityPdf implements ShouldQueue
try{
if(!Storage::disk($this->disk)->exists($path))
Storage::disk($this->disk)->makeDirectory($path, 0775);
Storage::disk($this->disk)->put($file_path, $pdf);
Storage::disk($this->disk)->put($file_path, $pdf, 'public');
}
catch(\Exception $e)

View File

@ -108,11 +108,9 @@ class GenerateDeliveryNote
}
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);
//return Storage::disk($this->disk)->path($file_path);
Storage::disk($this->disk)->put($file_path, $pdf, 'public');
return $file_path;
}