From 8bda15601baedc2e70fd392afea4f5caa32d4054 Mon Sep 17 00:00:00 2001 From: Marius Sucevan <57497646+msucevan@users.noreply.github.com> Date: Thu, 29 Feb 2024 20:51:58 +0100 Subject: [PATCH] Add support for visibility This commit is aimed to support the visibility, in order to set to public when necessary specially when you need to use s3 as disk. --- src/PdfBuilder.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/PdfBuilder.php b/src/PdfBuilder.php index d192228..c5b8fea 100755 --- a/src/PdfBuilder.php +++ b/src/PdfBuilder.php @@ -42,6 +42,8 @@ class PdfBuilder implements Responsable public ?array $margins = null; + protected string $visibility = 'private'; + protected ?Closure $customizeBrowsershot = null; protected array $responseHeaders = [ @@ -247,9 +249,10 @@ public function save(string $path): self return $this; } - public function disk(string $diskName): self + public function disk(string $diskName, string $visibility = 'private'): self { $this->diskName = $diskName; + $this->visibility = $visibility; return $this; } @@ -257,8 +260,9 @@ public function disk(string $diskName): self protected function saveOnDisk(string $diskName, string $path): self { $pdfContent = $this->getBrowsershot()->pdf(); + $visibility = $this->visibility; - Storage::disk($diskName)->put($path, $pdfContent); + Storage::disk($diskName)->put($path, $pdfContent, $visibility); return $this; }