Exemple #1
0
 /**
  * Update the specified tip in storage.
  *
  * The 'edited_by' field will be updated with the currently authenticated
  * user id.
  *
  * @Put("/{id}")
  * @Transaction(
  *     @Request({"body": "The lab is in GOL-1650."}),
  *     @Response(200, body={}),
  *     @Response(422, body={"body": {"The body field is required."}})
  * )
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function update(Request $request, $id)
 {
     $this->validate($request, ['body' => 'required']);
     $tip = Tip::findOrFail($id);
     $tip->body = $request->input('body');
     $tip->updated_by = $request->member->id;
     $tip->save();
     return response()->json($tip);
 }