/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update(Request $request, $id) { $info = Task::updateOrCreate(['id' => $id], $request->input()); if ($info) { return "Update success"; } else { return 'Update fail'; } }