Skip to content

Commit

Permalink
Update SitemapIndex.php For S3 Public Storage Option
Browse files Browse the repository at this point in the history
Add visibility option for sitemap index.
  • Loading branch information
bmckay959 authored Jan 16, 2024
1 parent a3e5c06 commit 07295d0
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 07295d0

Please # to comment.