0
votes

I am developing a Laravel application. I am installing Stripe payment method using the Cashier. Now, I am having a bit of an issue setting up quality for the Stripe plan on creating new subscription. This is how I create new subscription.

auth()->user()->newSubscription('prod_xxx', 'plan_x')-xx>create(request('stripeToken'));

The above code works perfectly fine. But when I tried to set the quality like this

auth()->user()->newSubscription('prod_xxx', 'plan_x')->updateQuality(5)->create(request('stripeToken'));

It does not work. It is saying updateQuality method does not exist. How can I set the quality with newSubscription all in one go?

2

2 Answers

0
votes

Better late than never, this might help others.

auth()->user()
    ->newSubscription('prod_xxx', 'plan_x')
    ->quantity(5)
    ->create(request('stripeToken'));