Skip to content
This repository has been archived by the owner on May 26, 2023. It is now read-only.

Change plan or/and renew plan period #159

Open
elephantux opened this issue May 25, 2023 · 1 comment
Open

Change plan or/and renew plan period #159

elephantux opened this issue May 25, 2023 · 1 comment

Comments

@elephantux
Copy link

How do I change the plan for a user who already has an active plan and have the expiration dates updated based on the data from the new plan?

Everything is changing and updating with changePlan($plan) method except for the starts_at & ends_at dates.

@elephantux
Copy link
Author

My solution:

$user->subscription()->changePlan($plan);
$user->subscription()->update([
    'starts_at' => null,
    'ends_at' => null
]);
$user->subscription()->renew();

But I don't think that's the right or best solution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant