From 243d1c06fcbfec4aa031393356621b4876439b4a Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Wed, 29 Nov 2023 16:34:31 +0100 Subject: [PATCH] cloud: disable trial --- app/Http/Livewire/Subscription/PricingPlans.php | 5 +++++ config/constants.php | 2 +- resources/views/components/pricing-plans.blade.php | 11 +++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/Http/Livewire/Subscription/PricingPlans.php b/app/Http/Livewire/Subscription/PricingPlans.php index 77c550d1e..07ee7c792 100644 --- a/app/Http/Livewire/Subscription/PricingPlans.php +++ b/app/Http/Livewire/Subscription/PricingPlans.php @@ -11,6 +11,9 @@ class PricingPlans extends Component public bool $isTrial = false; public function mount() { $this->isTrial = !data_get(currentTeam(),'subscription.stripe_trial_already_ended'); + if (config('constants.limits.trial_period') == 0) { + $this->isTrial = false; + } } public function subscribeStripe($type) { @@ -63,6 +66,7 @@ class PricingPlans extends Component ]; if (!data_get($team,'subscription.stripe_trial_already_ended')) { + if (config('constants.limits.trial_period') > 0) { $payload['subscription_data'] = [ 'trial_period_days' => config('constants.limits.trial_period'), 'trial_settings' => [ @@ -71,6 +75,7 @@ class PricingPlans extends Component ] ], ]; + } $payload['payment_method_collection'] = 'if_required'; } $customer = currentTeam()->subscription?->stripe_customer_id ?? null; diff --git a/config/constants.php b/config/constants.php index 4febbf043..7bab10a56 100644 --- a/config/constants.php +++ b/config/constants.php @@ -22,7 +22,7 @@ return [ 'official' => 'https://cdn.coollabs.io/coolify/service-templates.json', ], 'limits' => [ - 'trial_period' => 7, + 'trial_period' => 0, 'server' => [ 'zero' => 0, 'self-hosted' => 999999999999, diff --git a/resources/views/components/pricing-plans.blade.php b/resources/views/components/pricing-plans.blade.php index aabf7bde6..7837bc0f5 100644 --- a/resources/views/components/pricing-plans.blade.php +++ b/resources/views/components/pricing-plans.blade.php @@ -21,8 +21,11 @@ -
{{ config('constants.limits.trial_period') }} - days trial included on all plans, without credit card details.
+ @if (config('constants.limits.trial_period') > 0) +
{{ config('constants.limits.trial_period') }} + days trial included on all plans, without credit card details.
+ @endif
Save 10% annually with the yearly plans.
@@ -255,8 +258,8 @@
Need official support for your self-hosted instance? - Contact Us + Contact + Us