Illuminate\Database\Eloquent\Model::incrementOrDecrement PHP Method

incrementOrDecrement() protected method

Run the increment or decrement method on the model.
protected incrementOrDecrement ( string $column, integer $amount, array $extra, string $method ) : integer
$column string
$amount integer
$extra array
$method string
return integer
    protected function incrementOrDecrement($column, $amount, $extra, $method)
    {
        $query = $this->newQuery();
        if (!$this->exists) {
            return $query->{$method}($column, $amount, $extra);
        }
        $this->incrementOrDecrementAttributeValue($column, $amount, $method);
        return $query->where($this->getKeyName(), $this->getKey())->{$method}($column, $amount, $extra);
    }
Model