Add helpers for paid plans

This commit is contained in:
David Bomba 2023-12-20 19:53:03 +11:00
parent e6a3af5a54
commit fb6fd8b084
3 changed files with 30 additions and 3 deletions

View File

@ -1 +1 @@
5.7.62
5.7.63

View File

@ -330,6 +330,33 @@ class Account extends BaseModel
return $this->plan == 'enterprise';
}
public function isEnterprisePaidClient(): bool
{
if (! Ninja::isNinja()) {
return false;
}
return $this->isEnterpriseClient() && $this->isPaid();
}
public function isProClient(): bool
{
if (! Ninja::isNinja()) {
return false;
}
return $this->plan == 'pro';
}
public function isProPaidClient(): bool
{
if (! Ninja::isNinja()) {
return false;
}
return $this->isProClient() && $this->isPaid();
}
public function isTrial(): bool
{
if (! Ninja::isNinja()) {

View File

@ -17,8 +17,8 @@ return [
'require_https' => env('REQUIRE_HTTPS', true),
'app_url' => rtrim(env('APP_URL', ''), '/'),
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
'app_version' => env('APP_VERSION', '5.7.62'),
'app_tag' => env('APP_TAG', '5.7.62'),
'app_version' => env('APP_VERSION', '5.7.63'),
'app_tag' => env('APP_TAG', '5.7.63'),
'minimum_client_version' => '5.0.16',
'terms_version' => '1.0.1',
'api_secret' => env('API_SECRET', false),