/** * Show the users index page. * * @return \Response */ public function getIndex() { //$users = $this->users->findAllPaginated(); $tagList = $this->tags->listAll(); $categoryList = $this->categories->listAll(); $userList = $this->users->listAllCompany(); $this->view('admin.users.jobOpp', compact('tagList', 'categoryList', 'userList')); }
/** * Show the edit trick page. * * @param string $slug * @return \Response */ public function getEdit($slug) { $trick = $this->trick->findBySlug($slug); $tagList = $this->tags->listAll(); $categoryList = $this->categories->listAll(); $selectedTags = $this->trick->listTagsIdsForTrick($trick); $selectedCategories = $this->trick->listCategoriesIdsForTrick($trick); $this->view('tricks.edit', ['tagList' => $tagList, 'selectedTags' => $selectedTags, 'categoryList' => $categoryList, 'selectedCategories' => $selectedCategories, 'trick' => $trick]); }
/** * 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; }
/** * Delete a category from the database. * * @param mixed $id * @return \Illuminate\Http\RedirectResponse */ public function getDelete($id) { $this->categories->delete($id); return $this->redirectRoute('admin.categories.index'); }
/** * Show the categories index. * * @return \Response */ public function getCategoryIndex() { $categories = $this->categories->findAllWithTrickCount(); $this->view('browse.categories', compact('categories')); }
/** * Get all the categories to include in the sitemap. * * @return \Illuminate\Database\Eloquent\Collection|\Tricks\Category[] */ public function getCategories() { return $this->categories->findAll(); }