From 5d27e89bfa0e4e6eb17a3b3f9700f0aba67e13aa Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 12 Sep 2023 11:23:31 +0200 Subject: [PATCH] feat: dynamic trial period --- app/Http/Livewire/Subscription/PricingPlans.php | 2 +- config/constants.php | 1 + resources/views/components/pricing-plans.blade.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Livewire/Subscription/PricingPlans.php b/app/Http/Livewire/Subscription/PricingPlans.php index d200ecd15..a310b69f4 100644 --- a/app/Http/Livewire/Subscription/PricingPlans.php +++ b/app/Http/Livewire/Subscription/PricingPlans.php @@ -59,7 +59,7 @@ public function subscribeStripe($type) if (!data_get($team,'subscription.stripe_trial_already_ended')) { $payload['subscription_data'] = [ - 'trial_period_days' => 30, + 'trial_period_days' => config('constants.limits.trial_period'), 'trial_settings' => [ 'end_behavior' => [ 'missing_payment_method' => 'cancel', diff --git a/config/constants.php b/config/constants.php index 0021f8a5c..4cb112855 100644 --- a/config/constants.php +++ b/config/constants.php @@ -10,6 +10,7 @@ ], ], 'limits' => [ + 'trial_period'=> 14, '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 ce8d81c20..552247a74 100644 --- a/resources/views/components/pricing-plans.blade.php +++ b/resources/views/components/pricing-plans.blade.php @@ -21,7 +21,7 @@ class="sr-only"> -
30 days trial included on all plans, without credit card details.
+
{{config('constants.limits.trial_period')}} days trial included on all plans, without credit card details.
Save 1 month annually with the yearly plans.