firstOrFail(); $posts = $tag->posts()->has('media')->orderBy('id','desc')->paginate(12); $count = $tag->posts()->has('media')->orderBy('id','desc')->count(); return view('discover.tags.show', compact('tag', 'posts', 'count')); } }