public function tag($slug) { $tag = Tag::getBy($slug); if (empty($tag)) { abort(404); } $data['tag'] = $tag; $data['tags'] = Tag::all(); $data['sidebar'] = (object) ['latest_posts' => Post::getLatest(), 'popular_posts' => Post::getPopular()]; return view('home.post', $data); }