From 974d614075d5e31f301818b6dd42a5d216c78301 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 22 Jul 2022 11:00:29 +1000 Subject: [PATCH] Fixes for hosted --- app/Models/Account.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/Models/Account.php b/app/Models/Account.php index 2ea57856c5c0..3e08838b44db 100644 --- a/app/Models/Account.php +++ b/app/Models/Account.php @@ -227,6 +227,9 @@ class Account extends BaseModel return false; } + if($this->plan_expires && Carbon::parse($this->plan_expires)->lt(now())) + return false; + return $this->plan == 'pro' || $this->plan == 'enterprise'; } @@ -236,7 +239,10 @@ class Account extends BaseModel return false; } - return $this->plan == 'free' || is_null($this->plan); + if($this->plan_expires && Carbon::parse($this->plan_expires)->lt(now())) + return true; + + return $this->plan == 'free' || is_null($this->plan) || empty($this->plan); } public function isEnterpriseClient()