Ejemplo n.º 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;
 }
 /**
  * Show the admin categories index page.
  *
  * @return \Response
  */
 public function getIndex()
 {
     $categories = $this->categories->findAll('order', 'asc');
     $this->view('admin.categories.list', compact('categories'));
 }
Ejemplo n.º 3
0
 /**
  * Get all the categories to include in the sitemap.
  *
  * @return \Illuminate\Database\Eloquent\Collection|\Tricks\Category[]
  */
 public function getCategories()
 {
     return $this->categories->findAll();
 }