Save or update the model in the database.

@param mixed $identifier
@param array $attributes

@return Eloquent
971380
public function update($identifier, array $attributes = [])
    {
        $instance = $identifier instanceof Eloquent
            ? $identifier
            : $this->repository->makeQuery()->findOrFail($identifier);

        $instance->fill($attributes);

        if ($instance->isDirty()) {
            $instance->save();
        }

        return $instance;
    }
269726
public function initialize($attributes, $id = null)
    {
        if ($this->started) {
            return $this;
        }
        
        $this->id = $id ?: $this->id;
        $this->attributes = $attributes;
        $this->started = true;
        
        return $this;
    }
935994
public function update(array $attributes)
    {
        $this->query->type = QueryType::$UPDATE;
        $this->query->updateAttributes = $attributes;
        return QueryExecutor::prepare($this->db, $this->query)->execute();
    }
633400
public function set($identifier, $value)
    {
        $attributes = $this->getData()->attributes;
        $attributes[$identifier] = $value;

        return $this;
    }
294079
public function update( array $attributes = [], array $options = [] )
    {
        if( ! $this->exists ) {
            return false;
        }
        $updated = $this->fill( $attributes )->save( $options );
        self::$lastUpdated = $this;
        return $updated;
    }
634194
public function update($id, array $attributes)
    {
        $user = $this->findById($id);

        $user->first_name = $attributes['first_name'];
        $user->last_name = $attributes['last_name'];
        $user->email = $attributes['email'];
        $user->permissions = $attributes['permissions'];

        if( array_key_exists('password', $attributes) )
        {
            $user->password = $attributes['password'];
        }

        $user->save();

        if ( array_key_exists('groups',$attributes) )
        {
            $this->syncGroups($attributes['groups'], $user);
        }

        $this->event->fire('users.update',array($user));

        return $user;
    }
1135198
public function update($id = null, $attributes = [])
    {
        // ID has to be defined
        if (!isset($id)) {
            throw new \InvalidArgumentException('Undefined ID to update', 400);
        }

        // Attributes have to be array
        if (!(isset($attributes)) || !is_array($attributes)) {
            throw new \InvalidArgumentException('Undefined attributes', 400);
        }

        // Perform before hook
        $attributes = $this->beforeUpdate($id, $attributes);

        // Remove non fillable attributes
        $fields = array_intersect_key($attributes, array_flip($this->fillable));

        // Validate attributes
        $this->setValidationRules();
        $errors = $this->validationErrors($fields);
        if ($errors) {
            throw new Exceptions\ValidationException('Invalid attributes', 400, $errors);
        }

        // Update the model
        if ($fields && count($fields)) {
            $result = $this->db()->table($this->table)->where($this->primaryKey, $id, '=', $this->table)->update($fields);

            // Return false if the update failed
            if (!$result) {
                throw new \Exception('Could not update the model', 500);
            }
        }

        // Sync many to many relationships
        $this->sync($id, $attributes);

        // Upsert has many relationships
        $this->updateHasMany($id, $attributes);

        // Get the created model
        $model = $this->find($id);

        // Run after hook
        $model = $this->afterUpdate($id, $attributes, $model);

        // Return the created model
        return $model;
    }
831353
private function getItemData($identifiers, array $attributes, array $context)
    {
        return $this->itemDataProvider->getItem($attributes['resource_class'], $identifiers, $attributes['item_operation_name'], $context);
    }
365909
public function update(array $attributes, $id)
    {
        $this->applyScope();

        $model = $this->model->findOrFail($id);
        $model->fill($attributes);
        $model->save();

        $this->applyAfterSave($model);

        $this->resetModel();

        event(new RepositoryEntityUpdated($this, $model));

        return $this->parserResult($model);
    }
14201
protected function resolveModelAndIdentifier($model, $identifier)
    {
        $resolve = new ResolveComponentModelIdentifier($model, $identifier);

        return $this->getComponentDataResolver()->resolveComponentData($resolve);
    }
935405
public function create(array $attributes)
    {
        $this->applyAncestor();
        $this->applyCriteria();
        $this->applyScope();

        $model = $this->model->create($attributes);

        $model->save();

        $this->applyAfterSave($model);
        $this->resetModel();

        event(new RepositoryEntityCreated($this, $model));

        return $this->parserResult($model);
    }
778852
public function update(array $data, array $identifiers)
    {
        $this->getConnection()->update(
            $this->getTableName(),
            $data,
            $identifiers
        );
    }
1077962
public function fill(Identifiable $model, array $attributes)
    {

        $model = $this->checkTypeAndReturn($model);
        $changed = false;

        foreach ($attributes as $key=>$value) {
            // Check for exact comparison
            if(isset($model[$key]) && $model[$key] === $value) {
                continue;
            }
            $model[$key] = $value;
            $changed = true;
        }
        return $changed;
    }
722976
public function createOrUpdate(array $where, array $attributes)
    {
        $this->applyCriteria();
        $this->applyScope();

        $_skipPresenter = $this->skipPresenter;

        $this->skipPresenter(true);

        $model = $this->model->firstOrCreate($where);
        $model->fill($attributes);
        $model->save();

        $this->skipPresenter($_skipPresenter);
        $this->resetModel();

        event(new RepositoryEntityUpdated($this, $model));

        return $this->parserResult($model);
    }
143796
public function update(array $attributes = [], array $options = [])
    {
        if (! $this->exists) {
            return false;
        }

        return $this->fill($attributes)->save($options);
    }
839939
public function update(Identifiable $model, array $newAttributes)
    {
        $this->checkIsModel($model);

        $this->validate($newAttributes, 'update');

        if (!$this->fill($model, $newAttributes)) {
            return false;
        }

        $this->callBeforeListeners('update', [$model, $newAttributes]);

        $this->save($model);

        $this->callAfterListeners('update', [$model, $newAttributes]);

        return true;
    }
335770
public function store($identifier, $data)
    {
        // Find the user id
        if (!is_numeric($identifier))
        {
            if(!$identifier = JUserHelper::getUserId($identifier)) {
                $identifier = 0;
            }
        }

        return parent::store($identifier, $data);
    }