From d1e255aea828b6139bfc639e22c77d8d7c93908b Mon Sep 17 00:00:00 2001 From: Michael Aerni Date: Wed, 30 Oct 2024 17:43:19 -0400 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20generate=20sitemaps=20when=20cr?= =?UTF-8?q?awling=20is=20disabled?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Commands/GenerateSitemaps.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Commands/GenerateSitemaps.php b/src/Commands/GenerateSitemaps.php index 01cdd76..f34851f 100644 --- a/src/Commands/GenerateSitemaps.php +++ b/src/Commands/GenerateSitemaps.php @@ -28,6 +28,10 @@ public function handle() return error('The sitemap feature is disabled. You need to enable it to generate the sitemaps.'); } + if (! in_array(app()->environment(), config('advanced-seo.crawling.environments', []))) { + return error('The current environment is protected from being crawled. To generate the sitemaps, you need to add this environment to the crawling config.'); + } + $this->shouldQueue = $this->option('queue'); if ($this->shouldQueue && config('queue.default') === 'sync') {