diff --git a/CHANGELOG.md b/CHANGELOG.md index 6dbe6bd..7499ec1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ All notable changes to `laravel-licenser` will be documented in this file. +### 4.0.1 +- Fixed deallocation issue + ### 4.0.0 - Deallocation logic diff --git a/src/License.php b/src/License.php index 2e7f07b..feaaecc 100644 --- a/src/License.php +++ b/src/License.php @@ -104,12 +104,8 @@ public function allocate($quantity, $add = false) public function deallocate($quantity, $sub = false) { $used = $this->used(); - if ($used - $quantity >= 0) { - if(!$sub) { - $this->error($this->deallocateMessage($used, $quantity)); - } else { - $this->sub($quantity); - } + if ($used - $quantity >= 0 && $sub) { + $this->sub($quantity); } $this->deallocateSuccess($quantity);