/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show(Tag $tag) { if (Auth::user() && Auth::user()->isAdmin()) { $posts = $tag->post()->simplePaginate(10); } else { $posts = $tag->post()->publics()->simplePaginate(10); } return view('tags.show', compact('posts', 'tag')); }
/** * Display the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function show(Tag $tag) { $posts = $tag->post()->simplePaginate(10); return view('tags.show', compact('posts', 'tag')); // }