Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

feat: dynamic trial period

Andras Bacsai5d27e89bfa0e
diff --git a/app/Http/Livewire/Subscription/PricingPlans.php b/app/Http/Livewire/Subscription/PricingPlans.php
index d200ecd150..a310b69f4f 100644
--- a/app/Http/Livewire/Subscription/PricingPlans.php
+++ b/app/Http/Livewire/Subscription/PricingPlans.php
@@ -59,7 +59,7 @@ class PricingPlans extends Component
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 0021f8a5c2..4cb112855b 100644
--- a/config/constants.php
+++ b/config/constants.php
@@ -10,6 +10,7 @@ return [
],
],
'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 ce8d81c209..552247a74e 100644
--- a/resources/views/components/pricing-plans.blade.php
+++ b/resources/views/components/pricing-plans.blade.php
@@ -21,7 +21,7 @@
</label>
</fieldset>
</div>
- <div class="py-2 text-center"><span class="font-bold text-warning">30 days trial</span> included on all plans, without credit card details.</div>
+ <div class="py-2 text-center"><span class="font-bold text-warning">{{config('constants.limits.trial_period')}} days trial</span> included on all plans, without credit card details.</div>
<div x-show="selected === 'monthly'" class="flex justify-center h-10 mt-3 text-sm leading-6 ">
<div>Save <span class="font-bold text-warning">1 month</span> annually with the yearly plans.
</div>