From 07295d04c87e2ff1a45d9411bd19b78053cf99c8 Mon Sep 17 00:00:00 2001 From: Ben McKay Date: Tue, 16 Jan 2024 09:34:28 -0600 Subject: [PATCH] Update SitemapIndex.php For S3 Public Storage Option Add visibility option for sitemap index. --- src/SitemapIndex.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/SitemapIndex.php b/src/SitemapIndex.php index 859efb8..6d11dce 100644 --- a/src/SitemapIndex.php +++ b/src/SitemapIndex.php @@ -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; }