Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't subscribe user to plan #33

Closed
Yahav opened this issue Mar 21, 2018 · 1 comment
Closed

Can't subscribe user to plan #33

Yahav opened this issue Mar 21, 2018 · 1 comment

Comments

@Yahav
Copy link

Yahav commented Mar 21, 2018

When executing the following code:
$user = Auth::user(); $plan = Plan::find(1); $user->newSubscription('Free', $plan)->create();

I'm getting the following errors:
Illuminate \ Database \ QueryException (22007) SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2117-03-21 15:18:06' for column 'ends_at' at row 1 (SQL: insert into plan_subscriptions (plan_id, trial_ends_at, name, subscribable_id, subscribable_type, starts_at, ends_at, updated_at, created_at) values (1, , Free, 1, App\Models\User, 2018-03-21 15:18:06, 2117-03-21 15:18:06, 2018-03-21 15:18:06, 2018-03-21 15:18:06))

@Yahav
Copy link
Author

Yahav commented Mar 26, 2018

Found the error, i set the plan to:

'interval' => 'year',
'interval_count' => 99,

which caused this issue.
changed it to 20 and it works

EDIT:
didn't solved the issue apparently:

SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2038-03-26 08:00:31' for column 'ends_at' at row 1 (SQL: insert into plan_subscriptions (plan_id, trial_ends_at, name, subscribable_id, subscribable_type, starts_at, ends_at, updated_at, created_at) values (6, , Free, 1, App\Models\User, 2018-03-26 08:00:31, 2038-03-26 08:00:31, 2018-03-26 08:00:31, 2018-03-26 08:00:31))

EDIT:
So, setting it to 3 years did solve the issue, this whole thing is an extension of the following:
#32

This can be closed.

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

No branches or pull requests

1 participant