/** * Display a listing of the resource associated with the tag name. * * @param Tag $tag * @return \Illuminate\Http\Response */ public function tagged(Tag $tag) { $admin = User::first(); $tags = Tag::all(); $articles = $tag->publishedArticles()->get(); $currentTag = $tag; return view($this->theme() . 'home', compact('articles', 'currentTag', 'admin', 'tags')); }
/** * Display a listing of the articles associated to the tag. * * @return \Illuminate\Http\Response */ public function show(Tag $tag) { $published = $tag->publishedArticles()->paginate(10, ['*'], 'published_page'); $unpublished = $tag->unpublishedArticles()->paginate(10, ['*'], 'unpublished_page'); return view('tags.articles', compact('published', 'unpublished', 'tag')); }