예제 #1
0
 /**
  * Add URLs to dynamic pages of the site.
  *
  * @return void
  */
 public function addDynamicRoutes()
 {
     $tricks = $this->tricks->findAllForSitemap();
     foreach ($tricks as $trick) {
         $this->sitemap->add(URL::to("tricks/{$trick->slug}"), $trick->created_at, '0.9', 'weekly');
     }
     $categories = $this->categories->findAll();
     foreach ($categories as $category) {
         $this->sitemap->add(URL::to("categories/{$category->slug}"), $category->created_at, '0.9', 'daily');
     }
     $tags = $this->tags->findAll();
     foreach ($tags as $tag) {
         $this->sitemap->add(URL::to("tags/{$tag->slug}"), $tag->created_at, '0.9', 'daily');
     }
     return $this->sitemap;
 }
예제 #2
0
 /**
  * Get all the tricks to include in the sitemap.
  *
  * @return \Illuminate\Database\Eloquent\Collection|\Tricks\Trick[]
  */
 public function getTricks()
 {
     return $this->tricks->findAllForSitemap();
 }