are you sure your plan value is not gotten from your local database rather than stripe?
Laravel Cashier confusion
Hi All, I was hoping someone could point me to a good Laravel cashier tutorial. I tried following the Docs and a few other tutorials online but I am getting pretty confused. I (incorrectly I think) assumed that Laravel subscription_types aligned with each product in my stripe account. So if I have a normal plan and a premium plan I should have a Normal Plan and Premium Plan subscription type and in stripe make two products named Normal Plan and Premium Plan. However, looking into the Laravel documentation it looks like when I switch plans
$user->subscription('Normal Plan')->swap('provider-plan-id');
it doesn't actually switch the plan name, it just changes the stripe_id plan. So even though in stripe I see the premium plan being charged, Laravel still shows the name of the subscription as Normal Plan. I'm guessing that means I am looking at the laravel subscription name incorrectly, but I am finding it very confusing.
Is there a tutorial that explains the subscriptions like I am 5?
@chrisgrim If customers subscribe to use your application (but can pick from one of many plans, i.e. standard and premium) then yeah, leave the subscription name as “default” or something. The stripe_plan column determines what plan a customer is subscribed to, and how much and how often they will be charged.
If customers can subscribe for a variety of reasons, then that’s when you might want to use different names. For example, in my SaaS CMS (think Squarespace), the default name for subscriptions is “website” and there are two plans: a monthly plan and a yearly plan. However, users can also have subscriptions for other things such as mailboxes and domain names if I’ve registered one on their behalf. So for mailboxes, I‘ll have a subscription with the name email, the stripe_plan set to the plan I use for mailboxes, and the quantity set to the number of mailboxes the customer actually has. So I can pricing similar to G Suite where I charge X dollars per mailbox per month.
Same with domain names. I can have a subscription called domain with the stripe_plan column set to the Stripe plan I use for domains.
This is obviously a more complicated set-up than your traditional, “I have a SaaS, I want to charge a subscription for it”, but hopefully clears up the difference and the intended usage of both the subscription name column the stripe_plan column.
Please or to participate in this conversation.