/** * Display a listing of the resource based on a tag. * * @param $slug * * @return \Illuminate\View\View */ public function tag($slug) { $tag = $this->tags->findByField('slug', $slug)->first(); $posts = $tag->posts()->with(['author', 'tags'])->paginate(5); $tags = $this->tags->all(); return view('frontend.pages.blog.tag', compact('tag', 'posts', 'tags')); }
/** * Display a listing of the resource. * * @return \Illuminate\View\View */ public function index() { $tags = $this->tags->all(); return view('backend.tags.index', compact('tags')); }
/** * Display a listing of the resource. * * @return \Illuminate\View\View */ public function index() { $works = $this->works->with('tags')->all(); $tags = $this->tags->all(); return view('frontend.pages.works.index', compact('works', 'tags')); }
/** * Get all Tags used to group posts. * * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View */ public function groupByTag() { $tags = $this->tag->all(); return view('front.archive.tag', compact('tags')); }
/** * Display a listing of the resource. * * @return \Illuminate\View\View */ public function indexRaw() { $tags = $this->tags->all()->pluck('name'); return $tags; }