Illuminate\Database\Query\Builder::update PHP Method

update() public method

Update a record in the database.
public update ( array $values ) : integer
$values array
return integer
    public function update(array $values)
    {
        $sql = $this->grammar->compileUpdate($this, $values);
        return $this->connection->update($sql, $this->cleanBindings($this->grammar->prepareBindingsForUpdate($this->bindings, $values)));
    }

Usage Example

 /**
  * Restore the soft-deleted model instances.
  *
  * @return int
  */
 public function restore()
 {
     if ($this->model->isSoftDeleting()) {
         $column = $this->model->getDeletedAtColumn();
         return $this->query->update(array($column => null));
     }
 }
All Usage Examples Of Illuminate\Database\Query\Builder::update