/** * Toggle blog toped. * * /admin/blogs/toggleTop/{id} put * * @param integer $id * * @return \Illuminate\Http\JsonResponse */ public function toggleTop($id) { if ($this->blogs->toggleTop($id)) { $message = '博客顶置成功'; } else { $message = '博客取消顶置'; } return $this->responseJson(compact('message')); }
/** * Show blog. * * /blogs/{id} get * * @param integer $id * * @return \Illuminate\View\View */ public function show($id) { $blog = $this->blogs->findPublishedById($id); return view('blogs.show', compact('blog')); }