Update the specified resource in storage

@param array $id Resource ID
@return array Response
551937
public function update($id = null, $attributes = [])
    {
        // Check the ID
        if (!isset($id)) {
            throw new \InvalidArgumentException('Undefined ID', 400);
        }

        // Set the attributes
        $attributes = (!empty($attributes))? $attributes : $this->app->request->input();

        // Update the record
        $result = $this->model->update($id, $attributes);

        // Return results
        return [
            'success' => true,
            'id' => $id,
            'data' => $result
        ];
    }
812743
public function update(int $id, array $input)
    {
        return $this->model->find($id)->update($input);
    }
800595
public function update($id)
    {
        $request = $this->makeRequest('update');
        $model = $this->service->update($request, $id);

        if(is_a($model, \Exception::class)) {

            return $this->getErrorResource($model);

        } else {

            return $this->maybeMakeResource('single', $model, 201);
        }
    }
1039329
public function update($id, $params = array()) {
        $this->checkPermissions('update');
        
        return $this->client->updateData($this->resourceName . '/' . $id, $params);
    }
1132593
public function updateById($id, $attributes)
    {
        $attributes = $this->formatUpdateAttributes($attributes);

        $model = $this->model->find($id);

        if (empty($model))
            return $this;

        $model->update($this->mapAttributesWithScope($attributes));

        $apiModel = $this->getById($model->id);
        $this->afterUpdate($apiModel, $attributes);
        return $apiModel;
    }
1210143
public function update($id)
    {
        $content = $this->repository->getById($id);
        if (!empty($content)) {
            $this->authorize('update', $content);
            $input   = $this->validator->validate('update');
            $content = $this->repository->update($content, $input, auth()->user());
            return $this->respondWithSuccess($content, new ContentTransformer);
        }
        return $this->respondNotFound();
    }
777822
public function update(int $id, array $input)
    {
        $this->cache->tags($this->getModel())->flush();
        return $this->repository->update($id, $input);
    }
1132585
protected function __apiUpdate (string $id)
    {
        $record = HCGroups::findOrFail ($id);

        $data = $this->getInputData ();

        $record->update (array_get ($data, 'record', []));
        $record->users()->sync(array_get($data, 'users'));

        return $this->apiShow ($record->id);
    }
1309724
public function update($id, array $params = array())
    {
        $this->validateRequiredParameters(array('callbackURL', 'idModel'), $params);

        return $this->put($this->getPath().'/'.rawurlencode($id), $params);
    }
1207048
public function update($object, $id)
    {
        $objVars = get_object_vars($object);
        $body = array();
        foreach ($objVars as $key => $value) {
            if (null !== $value) {
                $body[$key] = $value;
            }
        }

        $ResourceName = $this->resourceName . ($id ? '/' . $id : null);
        $body = json_encode($body);

        list(, , $body) = $this->HttpClient->performHttpRequest(
            Common\HttpClient::REQUEST_PATCH,
            $ResourceName,
            false,
            $body
        );
        return $this->processRequest($body);
    }
1223080
public static function update($id, $params = [], $options = [])
    {
        $url = static::classUrl() . '/' . $id;
        return static::_directRequest('put', $url, $params, $options);
    }
475671
public function update($id)
    {
        $block = $this->repository->getById($id);
        if (!empty($block)) {
            $this->authorize('update', $block);
            $input = $this->validator->validate('update');
            $block = $this->repository->update($block, $input, auth()->user());
            return $this->respondWithSuccess($block, new BlockTransformer);
        }
        return $this->respondNotFound();
    }
365257
public function updateAction($id) {
        $entity = $this->container->get("haven_core.category.read_handler")->getOne($id);
        $delete_form = $this->container->get("haven_core.category.form_handler")->createDeleteForm($id);
        $edit_form = $this->container->get("haven_core.category.form_handler")->createEditForm($id);

        $request = $this->container->get('request_modifier')->setRequest($this->container->get("request"))
                ->slug(array("name"))
                ->getRequest();

        $edit_form->bind($request);
        if ($edit_form->isValid()) {
            $this->container->get("haven_core.category.persistence_handler")->save($edit_form->getData());

            $this->container->get("session")->getFlashBag()->add("success", "update.success");
            return new RedirectResponse($this->container->get('router')->generate(str_replace('update', "edit", $this->container->get("request")->get("_route")), array("id" => $entity->getId())));
        }

        $this->container->get("session")->getFlashBag()->add("error", "update.error");

        $template = str_replace(":update.html.twig", ":edit.html.twig", $this->container->get("request")->get('_template'));
        $params = array(
            'entity' => $entity,
            'edit_form' => $edit_form->createView(),
            'delete_form' => $delete_form->createView(),
        );

        return new Response($this->container->get('templating')->render($template, $params));
    }
621333
public function actionUpdate($id)
    {
        $this->layout = static::MAIN_LAYOUT;
        $model = $this->findModel($id);

        if ($model->load(Yii::$app->request->post()) && $model->save()) {
            $this->afterUpdate($model);
            return $this->redirect(['view', 'id' => $model->id]);
        } else {
            if($model->template) {
                return $this->render($model->template, [
                    'model' => $model,
                ]);
            } else {
                return $this->render('update', [
                    'model' => $model,
                ]);
            }
        }
    }
90208
public function update($id) {
		$rules    = [];
		$nicename = [];
		foreach (\L::all() as $l) {
			$nicename['name_'.$l] = trans('admin.name_'.$l);
			$rules['name_'.$l]    = 'required';
		}
		$this->validate(request(), $rules, [], $nicename);
		session()->flash('success', trans('admin.updated'));
		$data = request()->except(['_token', '_method', 'parent']);
		if (request()->input('parent') != null) {
			$data['parent'] = request('parent');
		} else {
			$data['parent'] = null;
		}
		$data['admin_id'] = admin()->user()->id;

		if (request()->hasFile('icon')) {
			$dep = Dep::find($id);
			!empty($dep->icon)?Up::del_icon($dep->icon):'';// Delete Icon If Has File
			$data['icon'] = it()->upload(request()->file('icon'), 'departments/'.time(), 'icon');
		}

		if (request()->has('color')) {
			$data['color'] = request('color');
		}

		Dep::where('id', $id)->update($data);
		return back();
	}
90464
public function update($id)
    {
        $model = ApiUsers::query()->findOrFail($id);
        $form  = $this->getForm($model);
        $url   = url()->previous();
        if (!$form->isValid()) {
            return $this->redirectWithErrors($url, $form->getMessageBag());
        }
        $model->enabled = input('api', 'off') === 'on';
        if (!is_null($whitelist      = input('whitelist'))) {
            $model->whitelist = $whitelist;
        }
        if (!$model->save()) {
            return $this->redirectWithMessage($url, trans('antares/api::response.user_config_not_saved'), 'error');
        }
        return $this->redirectWithMessage($url, trans('antares/api::response.user_config_saved'));
    }
1301325
protected function __apiUpdate (string $id)
    {
        $record = HCPagesCategories::findOrFail($id);

        $data = $this->getInputData();

        $record->update(array_get($data, 'record'));
        $record->updateTranslations(array_get($data, 'translations'));

        return $this->apiShow($record->id);
    }