Skip to content

Commit

Permalink
Merge pull request #92 from msucevan/support-visibility
Browse files Browse the repository at this point in the history
Add support for visibility
  • Loading branch information
freekmurze committed Mar 1, 2024
2 parents c51c8b4 + 8bda156 commit 69957c4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/PdfBuilder.php
Expand Up @@ -42,6 +42,8 @@ class PdfBuilder implements Responsable

public ?array $margins = null;

protected string $visibility = 'private';

protected ?Closure $customizeBrowsershot = null;

protected array $responseHeaders = [
Expand Down Expand Up @@ -247,18 +249,20 @@ 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;
}

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;
}
Expand Down

0 comments on commit 69957c4

Please sign in to comment.