From 552a2682842b0db00b974d06b96a9f0766dea4ef Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Mon, 27 Apr 2020 14:15:04 +0200 Subject: [PATCH] Fix add and remove plan --- src/Subscription.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Subscription.php b/src/Subscription.php index 87cdf5db..d8b721a8 100644 --- a/src/Subscription.php +++ b/src/Subscription.php @@ -720,7 +720,7 @@ public function addPlan($plan, $quantity = 1, $options = []) $this->unsetRelation('items'); - if ($this->items()->count() > 1) { + if ($this->hasSinglePlan()) { $this->fill([ 'stripe_plan' => null, 'quantity' => null, @@ -774,7 +774,7 @@ public function removePlan($plan) $this->unsetRelation('items'); - if ($this->items()->count() === 1) { + if ($this->items()->count() < 2) { $item = $this->items()->first(); $this->fill([