update() public method

Update new blog.
public update ( $id, array $data )
$data array
示例#1
0
 /**
  * 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' => '修改成功']);
 }