Reputation: 1858
I am currently using Cashier (Stripe) to the Plan subscription. I am currently using $this->subscription->swapAndInvoice($this->selected->stripe_plan_id);
like this to change the subscription plan. Here i want to know how can i add trial period (7days) when i change subscription plan?
If anyone have any idea? please give your thoughts.
Upvotes: 0
Views: 631
Reputation: 7419
This doesn't appear to be an optional parameter directly in the swapAndInvoice
function, but you should be able to update the subscription immediately before the swap to add a trial:
$subscription->extendTrial(
now()->addDays(7)
);
The docs say that if a trial exists, it will be preserved:
If the user is on trial, the trial period will be maintained.
Upvotes: 1