| @@ 37-48 (lines=12) @@ | ||
| 34 | * |
|
| 35 | * @return mixed |
|
| 36 | */ |
|
| 37 | public function increment(Model $model) |
|
| 38 | { |
|
| 39 | if ($this->isValidModel($model)) { |
|
| 40 | if (!(bool) config('increment-decrement.first_row_can_increment')) { |
|
| 41 | if ($model->{$this->column} <= 1) { |
|
| 42 | return false; |
|
| 43 | } |
|
| 44 | } |
|
| 45 | ||
| 46 | return $this->orderInfo->increment($model); |
|
| 47 | } |
|
| 48 | } |
|
| 49 | ||
| 50 | /** |
|
| 51 | * @param Model $model |
|
| @@ 55-66 (lines=12) @@ | ||
| 52 | * |
|
| 53 | * @return mixed |
|
| 54 | */ |
|
| 55 | public function decrement(Model $model) |
|
| 56 | { |
|
| 57 | if ($this->isValidModel($model)) { |
|
| 58 | if (!(bool) config('increment-decrement.last_row_can_decrement')) { |
|
| 59 | if ($model->{$this->column} >= 1) { |
|
| 60 | return false; |
|
| 61 | } |
|
| 62 | } |
|
| 63 | ||
| 64 | return $this->orderInfo->decrement($model); |
|
| 65 | } |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * @param Model $model |
|