shouldCrawl(function (UriInterface $url) { /** * Prevent the crawler from crawling the random pages. */ return strpos($url->getPath(), '/random') === false; }) ->writeToFile(public_path('sitemap.xml')); } }