repository = $tag; parent::__construct(); } /** * Show tag's list. * * @param string $slug * * @return response */ protected function index() { $tags = $this->repository->scopeQuery(function($query){ return $query->orderBy('id','DESC'); })->paginate(); return $this->theme->of('tag::public.tag.index', compact('tags'))->render(); } /** * Show tag. * * @param string $slug * * @return response */ protected function show($slug) { $tag = $this->repository->scopeQuery(function($query) use ($slug) { return $query->orderBy('id','DESC') ->where('slug', $slug); })->first(['*']); return $this->theme->of('tag::public.tag.show', compact('tag'))->render(); } }