content = $content; } /** * Get sitemap for all content pages * * @return mixed */ public function getMap() { // load all public pages $pages = $this->content->getPageQuery() ->get(); // iterate over all pages and add tag for each of them foreach ($pages as $page) { // is this page a homepage? because of URL if ($page->is_homepage) { $route = route('page.index'); $priority = 1; } else { $route = route('page.content', ['url' => $page->url]); $priority = 0.8; } // add to all pages \Sitemap::addTag($route, $page->updated_at, 'daily', $priority); } // print sitemap return \Sitemap::render(); } }