diff --git a/src/Sitemaps/SitemapRepository.php b/src/Sitemaps/SitemapRepository.php index e42dd52..724b103 100644 --- a/src/Sitemaps/SitemapRepository.php +++ b/src/Sitemaps/SitemapRepository.php @@ -46,6 +46,10 @@ public function find(string $id): ?Sitemap { $method = Str::before($id, '::').'Sitemaps'; + if (! method_exists($this, $method)) { + return null; + } + return $this->$method()->first(fn ($sitemap) => $id === $sitemap->id()); }