Update an existing model.

@param array $input

@throws \Exception

@return bool|int
335233
public function update(array $input = [])
    {
        DB::beginTransaction();

        try {
            LaravelEvent::fire(static::$name.'.updating', $this);
            $this->beforeUpdate($input);
            $return = parent::update($input);
            $this->afterUpdate($input, $return);
            LaravelEvent::fire(static::$name.'.updated', $this);

            DB::commit();
        } catch (\Exception $e) {
            DB::rollBack();
            throw $e;
        }

        return $return;
    }
254085
public static function findArray($input)
    {
        if (is_iterable($input) && self::test(current($input))) {
            return self::findArray(current($input));
        }

        if (self::test($input)) {
            return self::findArray(self::parse($input));
        }

        if (! is_iterable($input)) {
            throw new \Exception("Can't find an array in provided input");
        }

        return $input;
    }
436935
public function insert(array $input) : array {
		if (\Application::get('flag.numbers.framework.api.enforce_rest')) {
			$temp2 = $this->get($input);
			if (!$temp2['values_loaded']) {
				return $this->save($input);
			} else {
				return [
					'success' => false,
					'error' => ['Can not create, record exists!'],
					'values' => []
				];
			}
		} else {
			return $this->save($input);
		}
	}
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();
        }
    }
723079
protected function handleFileDelete(array $input = [])
    {
        if (array_key_exists(Field::FILE_DELETE_FLAG, $input)) {
            $input[Field::FILE_DELETE_FLAG] = $input['key'];
            unset($input['key']);
        }

        Input::replace($input);

        return $input;
    }
1024386
public function process(array $input)
    {
        try
        {
            $success = $this->v->validate($input);
        }
        catch(ValidationException $e)
        {
            $this->setErrorsAndThrowException();
        }
        if( ! $success)
        {
            $this->setErrorsAndThrowException();
        }

        Event::fire("form.processing", array($input));
        return $this->callRepository($input);
    }
1084680
public function update(array $input) : array {
		if (\Application::get('flag.numbers.framework.api.enforce_rest')) {
			$temp2 = $this->get($input);
			if ($temp2['values_loaded']) {
				return $this->save($input);
			} else {
				return [
					'success' => false,
					'error' => ['Can not update, record does not exists!'],
					'values' => []
				];
			}
		} else {
			return $this->save($input);
		}
	}
706606
public function update($id, $input)
    {
        $this->model = $this->model->query()->findOrFail($id);

        $this->model = $this->model->fill($input);

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

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

        return $this->model->save();
    }
461988
public function update(array $data)
    {
        $cardId = empty($data['id']) ? 0: (int) $data['id'];
        if ($cardId <= 0) {
            throw new Exception('Required field id');
        }
        $data['cardId'] = $data['id'];
        unset($data['id']);

        if (empty($data['columnId'])) {
            throw new Exception('Required field columnId');
        }

        if (empty($data['oldColumnId'])) {
            throw new Exception('Required field oldColumnId');
        }

        return $this->rest->put("$this->action/$cardId/move", $data);
    }
1011987
public function addInput($input)
    {
        if (!$this->getInputs()) {
            return $this->setInputs(array($input));
        } else {
            return $this->setInputs(
                array_merge($this->getInputs(), array($input))
            );
        }
    }
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;
    }
937277
public function update(Listener $listener, array $input)
    {
        $user = Auth::user();

        if (! $this->validateCurrentUser($user, $input)) {
            return $listener->abortWhenUserMismatched();
        }

        $validation = $this->validator->on('update')->with($input);

        if ($validation->fails()) {
            return $listener->updateProfileFailedValidation($validation->getMessageBag());
        }

        try {
            $this->saving($user, $input);
        } catch (Exception $e) {
            return $listener->updateProfileFailed(['error' => $e->getMessage()]);
        }

        return $listener->profileUpdated();
    }
548111
public function post(array $input) : array {
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_SAVE] = true;
		$input[\Object\Form\Parent2::BUTTON_SUBMIT_POST] = true;
		$this->form->form_object->addInput($input);
		$this->form->form_object->process();
		return $this->form->form_object->apiResult();
	}
441432
public function onlyFillable(array $input)
    {
        $result = array_intersect_key($input, array_flip($this->modelInstance->getFillable()));

        foreach ($this->avoidEmptyUpdate as $avoid) {
            if (array_key_exists($avoid, $result) && empty($result[$avoid])) {
                unset($result[$avoid]);
            }
        }

        return $result;
    }
32506
public function addInput($input)
    {
        $inputs = $this->getInputs();
        array_push($inputs, $input);
        $this->setInputs($inputs);
    }
989076
public function validate(array $input): bool
    {
        // Grab input fields and define the rules for user validations.
        $rules = [
            'email' => ['required', 'email'],
            'password' => ['required'],
            'fullname' => ['required'],
            'site_name' => ['required'],
        ];

        $validation = \app('validator')->make($input, $rules);

        // Validate user registration, we should stop this process if
        // the user not properly formatted.
        if ($validation->fails()) {
            throw new ValidationException($validation);
        }

        return true;
    }
707889
public function update(SettingUpdateListener $listener, array $input)
    {
        $input = new Fluent($input);
        $form  = $this->presenter->form($input);
        if (!$form->isValid()) {
            return $listener->settingFailedValidation($form->getMessageBag());
        }
        $memory = $this->memory;
        $memory->put('site.mode', $input['mode']);
        $memory->finish();
        return $listener->settingHasUpdated();
    }