Update row

@param integer $id    The object ID.
@param array   $input The input data.
@return \Illuminate\Database\Eloquent\Model
777822
public function update(int $id, array $input)
    {
        $this->cache->tags($this->getModel())->flush();
        return $this->repository->update($id, $input);
    }
66406
public function update($id)
    {
        /** @var FormRequest $request */
        $request = app($this->getUpdateRequestClass());
        $record  = $this->modelRepository->findOrFail($id);

        $data = $request->only($this->getRelevantFormFieldKeys());

        /** @var FormDataStorerInterface $storer */
        $storer = app(FormDataStorerInterface::class);
        $storer->setModelInformation($this->getModelInformation());

        if ( ! $storer->store($record, $data)) {
            // @codeCoverageIgnoreStart
            return redirect()->back()
                ->withInput()
                ->withErrors([
                    static::GENERAL_ERRORS_KEY => [ $this->getGeneralStoreFailureError() ],
                ]);
            // @codeCoverageIgnoreEnd
        }

        $this->storeActiveTab($request->input(static::ACTIVE_TAB_PANE_KEY));

        cms_flash(
            cms_trans(
                'models.store.success-message-edit',
                [ 'record' => $this->getSimpleRecordReference($id, $record) ]
            ),
            FlashLevel::SUCCESS
        );

        event( new Events\ModelUpdatedInCms($record) );

        if ($request->input(static::SAVE_AND_CLOSE_KEY)) {
            return redirect()->route("{$this->routePrefix}.index");
        }

        return redirect()->route("{$this->routePrefix}.edit", [ $record->getKey() ]);
    }
562421
public function update(array $input)
  {
    unset($input['_token']);
    $input = eloquent_array_filter_for_update($input);
    // $input['date'] = $this->Carbon->createFromFormat($this->Lang->get('form.phpShortDateFormat'), $input['date'])->format('Y-m-d');

    $this->DB->transaction(function() use (&$input)
    {
      $VoucherType = $this->VoucherType->byId($input['id']);
      $unchangedVoucherTypeValues = $VoucherType->toArray();

      $this->VoucherType->update($input, $VoucherType);

      $diff = 0;

      foreach ($input as $key => $value)
      {
        if($unchangedVoucherTypeValues[$key] != $value)
        {
          $diff++;

          if($diff == 1)
          {
            $Journal = $this->Journal->create(array('journalized_id' => $VoucherType->id, 'journalized_type' => $this->VoucherType->getTable(), 'user_id' => $this->AuthenticationManager->getLoggedUserId(), 'organization_id' => $this->AuthenticationManager->getCurrentUserOrganizationId()));
          }

          if($key == 'name')
          {
            $this->Journal->attachDetail($Journal->id, array('field' => $this->Lang->get('decima-accounting::voucher-type-management.name'), 'field_lang_key' => 'decima-accounting::voucher-type-management.name', 'old_value' => $this->Lang->get($unchangedVoucherTypeValues[$key]), 'new_value' => $this->Lang->get($value)), $Journal);
          }
          else
          {
            $this->Journal->attachDetail($Journal->id, array('field' => $this->Lang->get('decima-accounting::voucher-type-management.' . camel_case($key)), 'field_lang_key' => 'decima-accounting::voucher-type-management.' . camel_case($key), 'old_value' => $unchangedVoucherTypeValues[$key], 'new_value' => $value), $Journal);
          }
        }
      }
    });

    return json_encode(array('success' => $this->Lang->get('form.defaultSuccessUpdateMessage')));
  }
560045
protected function isUpdate($input)
    {
        return (isset($input[$this->id_name]) && ! empty($input[$this->id_name]) );
    }
109136
public function updateByStringId(array $data, string $id): Model
    {
        $model = $this->byStringIdOrFail($id);

        return $this->updateByModel($model, $data);
    }
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();
    }
238663
public function store($input)
    {
        $this->model = $this->model->fill($input);

        $filteredInput = $this->runChecks('store', $this->model->toArray());

        if ($filteredInput) {
            $this->model->fill($filteredInput);
        }

        return $this->model->save();
    }
1193550
public function update($id, array $data, $return_model = false){
        $model = $this->find($id);
        if($return_model){
            $model->update($data);
            return $model;
        }
        return $model->update($data);
    }
1185502
public function update($id, array $data)
    {
        $this->validateId($id);

        $entity = $this->getById($id);
        $form   = $this->getEditForm();

        $form->bind($entity);
        $form->setData($data);

        if (!$valid = $form->isValid()) {
            return false;
        }

        $this->updateFromNode($entity);

        $this->getMapper()->save($entity);

        return $entity;
    }
654327
public function update($id)
    {
        try {
            $entry = $this->collection->findOne($id);
        } catch (Exception $e) {
            // noop
        }

        if (is_null($entry)) {
            return $this->app->notFound();
        }

        if ($this->request->isPost() || $this->request->isPut()) {
            try {
                $merged = array_merge(
                    isset($entry) ? $entry->dump() : array(),
                    $this->request->getBody() ?: array()
                );

                $entry->set($merged)->save();

                h('notification.info', $this->clazz.' updated');

                h('controller.update.success', array(
                    'model' => $entry,
                ));
            } catch (Stop $e) {
                throw $e;
            } catch (Exception $e) {
                h('notification.error', $e);

                if (empty($entry)) {
                    $model = null;
                }

                h('controller.update.error', array(
                    'error' => $e,
                    'model' => $entry,
                ));
            }
        }

        $this->data['entry'] = $entry;
    }
54904
public function delete(array $input)
    {
        if(isset($input[$this->id_field_name]) && ! empty($input[$this->id_field_name]))
        {
            try
            {
                $this->r->delete($input[$this->id_field_name]);
            }
            catch(ModelNotFoundException $e)
            {
                $this->errors = new MessageBag(array("model" => "Element does not exists."));
                throw new NotFoundException();
            }
            catch(PermissionException $e)
            {
                $this->errors = new MessageBag(array("model" => "Cannot delete this item, please check that the item is not already associated to any other element, in that case remove the association first."));
                throw new PermissionException();
            }
        }
        else
        {
            $this->errors = new MessageBag(array("model" => "Id not given"));
            throw new NotFoundException();
        }
    }
525552
public function update(array $input, $id, Model $model = null, $attribute = 'id')
    {
        if ($model == null) {
            $model = $this->find($id, $attribute);
        }

        $model->update($this->onlyFillable($input));

        return $model;
    }
1315292
public static function custom($id, $input)
    {
        return (new static($id))->setInput($input instanceof BasicFormElement ? $input : new $input($id));
    }
297427
public function createOrUpdate($key, array $input, array $queryParams = [])
    {
        $response = $this->client->put($this->uri($key), [
            RequestOptions::JSON => ['setting' => $input],
            'query' => $queryParams,
        ]);

        return $this->handleResponse($response);
    }
194127
public function update($id, array $data)
    {
        $project = $this->client->put(sprintf('projects/%d.json', $id), [
            'json' => $data,
        ]);

        return new Project($this->response($project));
    }
63367
public function update($id, $data)
    {
        $response = $this->handler->handle('PUT', $data);

        return $this->make($response, false);
    }
200311
public function update(Model $model, array $input)
    {
        $updated = $model->update($input);

        if ($updated) {
            app('cache')->flush();
        }

        return $updated;
    }