/** * Display the specified resource. * * @param string $author_slug * @return \Illuminate\Http\Response */ public function show($author_slug) { $author = Author::getBySlug($author_slug); $posts = Post::whereHas('author', function ($query) use($author_slug) { $query->where('slug', $author_slug)->where('show_author', true); })->simplePaginate(); return view('flashtag::authors.show', compact('author', 'posts')); }
/** * Display the specified resource. * * @param string $category_slug * @return \Illuminate\Http\Response */ public function show($category_slug) { $category = Category::getBySlug($category_slug); $posts = Post::whereHas('category', function ($query) use($category_slug) { $query->where('slug', $category_slug); })->simplePaginate(); return view('flashtag::categories.show', compact('category', 'posts')); }
/** * Display the specified resource. * * @param string $tag_slug * @return \Illuminate\Http\Response */ public function show($tag_slug) { $tag = Tag::getBySlug($tag_slug); $posts = Post::whereHas('tags', function ($query) use($tag_slug) { $query->where('slug', $tag_slug); })->simplePaginate(10); return view('flashtag::tags.show', compact('tag', 'posts')); }