Alright, the preceding recipe made it possible for people to subscribe, but what happens when they want to change the plan or cancel it!
I will cover making an area where they can update or swap out their plan. You can take this much further at the UI level. I am keeping it very simple.
See the preceding recipes, as you really need to have the cashier set up to get this far.
I will make a controller to keep our logic in one controller:
> php artisan make:controller SubscriptionSwapController
Then, I will make the route for this controller:
Now, to add some logic to the repository class called
app/Repositories/SubscribeRepository.php
, the controller uses:Update the previous view for
resources/views/stripe/status.blade.php
:That's it! It will swap out memberships for you and make a new invoice.