Example #1
0
 /**
  * {@inheritdoc}
  */
 public function decrement($column, $decrement = 1)
 {
     if ($this->model->exists()) {
         $this->model->{$column} -= $decrement;
         $this->where($this->model->getPrimaryKey(), '=', $this->model->getPrimaryKeyValue());
     }
     $updated = parent::decrement($column, $decrement);
     if ($this->model->exists()) {
         $this->model->synchronize();
     }
     return $updated;
 }