Skip to content

Commit

Permalink
Update SitemapIndex.php for visibility
Browse files Browse the repository at this point in the history
Add public private visibility option
  • Loading branch information
bmckay959 authored Jan 16, 2024
1 parent 9ad7d89 commit 7c05f89
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/SitemapIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ public function writeToFile(string $path): static
return $this;
}

public function writeToDisk(string $disk, string $path): static
public function writeToDisk(string $disk, string $path, bool $public = false): static
{
Storage::disk($disk)->put($path, $this->render());
if($public) {
$visibility = 'public';
} else {
$visibility = 'private';
}

Storage::disk($disk)->put($path, $this->render(), $visibility);

return $this;
}
Expand Down

0 comments on commit 7c05f89

Please # to comment.