I'm trying to update a subscription and add a coupon at the same time. Here's the code:
$user->subscription('subscription_name')->withCoupon($request->stripe_coupons)->swap($planName);
The error I'm getting is Call to undefined method Laravel\Cashier\Subscription::withCoupon()
My understanding is that this should just work. If I remove the ->withCoupon()
bit, it works fine, and I can see the method in the cashier code. What am I doing wrong??
Because it's been mentioned, as far as I can tell I'm on the latest version. Cashier was installed using composer require laravel/cashier
, but that seems to have put me on "laravel/cashier": "^9.3",
in my composer.json file.
How do I fix?