Cashier 6.0.18, Laravel 5.2
According to docs, in order to skip the existent plan's trial before swapping to new plan i call:
$user->subscription('main')->skipTrial()->swap('provider-plan-id');
It seems though, that the skipTrial() method exists in SubscriptionBuilder Class , and not in Subscription.
As a result, if i try the code above i get:
BadMethodCallException in Builder.php line 2345:
Call to undefined method Illuminate\Database\Query\Builder::skipTrial()
Which is because i am calling the "skipTrial()" from a Subscription object, not from a SubscriptionBuilder and Subscription model has no such method.
I don't believe the swap method actually checks during a swap. It only checks the trial_ends_at field is null via the is onTrial() method. As a temporary workaround I am using the following:
$subscription = $user->subscription('main');
$subscription->trial_ends_at = null;
$subscription->swap($plan);
This is happening to me as well. Went with the workaround @cjke pasted.
PR submitted with a fix: https://github.com/laravel/cashier/pull/356
Most helpful comment
I don't believe the swap method actually checks during a swap. It only checks the
trial_ends_atfield is null via the isonTrial()method. As a temporary workaround I am using the following: