/** * Update the blog. * * /admin/blogs/{id} put * * @param integer $id * * @return \Illuminate\Http\JsonResponse */ public function update($id) { $form = $this->blogs->getUpdateForm(); if (!$form->isValid()) { return $this->responseJson(['errors' => $form->getErrors()], 400); } $this->blogs->update($id, $form->getInputData()); return $this->responseJson(['message' => '修改成功']); }