In this episode, we're diving into how to add lifetime memberships to our Laravel app with Stripe integration. We cover both letting customers sign up for a lifetime membership directly and allowing people to swap from a regular subscription to lifetime.
First, we start by adding a simple boolean column on the users table, called lifetime_membership
, so we know who is a lifetime member. We make sure our code can check this flag and reflect it everywhere in the app—especially for things like middleware and access checks.
Then, we build a new lifetime plan in Stripe, set it up in our database and configs, and add it to the UI as an option. The checkout flow for lifetime is a bit different since it’s a one-time payment instead of a recurring subscription, but we use Cashier’s checkout features to handle most of this. Importantly, we configure the webhook so that, when a one-off payment for lifetime completes, our backend gets the event and flips the user's lifetime_membership
flag on.
Swapping to lifetime from a monthly or yearly plan is covered too. When someone upgrades, we process their payment for lifetime and immediately cancel their existing subscription so they don’t get double-billed.
By the end, you’ll have a solid setup for supporting both recurring subscriptions and lifetime memberships in your Laravel/Stripe-powered site. There are lots of small tweaks you can make for your use case, but the core flow is all here!