iyzipay-laravel
iyzipay-laravel copied to clipboard
How to properly change plan?
I have two plans: monthly-plan
and yearly-plan
.
But of which have a trial period of 30 days.
I need to let the user switch plan.
First question:
Is this the proper way to change plan:
Subscription::where('billable_id', $user->id)->first()->setPlanAttribute($new_plan_id);
Second question: If I subscribe to another plan I will get the 30 days free trial. But what if every 29 days I keep switching plans and every time get the 30 days free trial? How can be avoided this?
Thanks