/** * 用于客户端的帖子详细 Web View. * * @param $id * * @return \Illuminate\View\View */ public function showWebView($id) { $topic = $this->topics->find($id, ['title', 'body', 'created_at', 'vote_count']); return view('api_web_views.topic', compact('topic')); }
/** * 反对帖子. * * @param $id * * @return \Illuminate\Http\Response */ public function voteDown($id) { $topic = $this->repository->find($id); return response(['vote-down' => $this->repository->voteDown($topic), 'vote_count' => $topic->vote_count]); }