Moving lemonsqueezy/laravel to Laravel Cashier on Stripe Managed Payments
If your Laravel app bills through the lemonsqueezy/laravel package, you have to move before Lemon Squeezy stops processing on March 31, 2027. The obvious replacement is Laravel Cashier (Stripe) with Stripe Managed Payments, which keeps Stripe as merchant of record. Most of the method names carry over. Four things don't, and each one can break checkout or lock paying users out.
TL;DR
- Use Cashier 16, not 15. Cashier 15 pins an API version that is too old for Managed Payments.
- Pass
managed_payments[enabled]=truethrough Cashier's checkout session options. - Remove
Cashier::calculateTaxes()andcollectTaxIds(). They add parameters that Managed Payments rejects. - Backfill subscriptions that Lemon Squeezy migrates. Until
users.stripe_idis populated, Cashier ignores Stripe webhooks for those customers, so its tables stay empty andsubscribed()returns false. - You can't put both
Billabletraits on one model. They define the same methods. Move one of them to another model and bridge access checks with a helper.
1. The version trap: Cashier 15 can't do Managed Payments
Stripe's Managed Payments Checkout guide says to use API version 2025-03-31.basil or later. Cashier 15's src/Cashier.php pins STRIPE_VERSION = '2023-10-16'. On the 16.x branch, STRIPE_VERSION follows stripe-php's current API version, and the 16.x release notes include basil-era fixes. Upgrade first, using the official UPGRADE.md. It has the schema and PHP/Laravel requirements, and we don't repeat them here.
2. Checkout with Managed Payments
Cashier's Checkout::create() merges your session options into the payload it sends to checkout.sessions.create, so the Managed Payments flag passes straight through:
// Sketch: not run against live Stripe.
// Subscription
return $request->user()
->newSubscription('default', 'price_monthly')
->checkout([
'managed_payments' => ['enabled' => true],
'success_url' => route('billing.success'),
'cancel_url' => route('billing'),
]);
// One-time product
return $request->user()->checkout(['price_ebook' => 1], [
'managed_payments' => ['enabled' => true],
'success_url' => route('billing.success'),
'cancel_url' => route('billing'),
]);
Every Stripe product you sell needs a tax code that Managed Payments accepts. Check yours with the Tax-Code Checker (it runs in your browser) or read which tax codes are eligible.
3. The tax-helper trap: what Cashier adds for you
On Lemon Squeezy, tax was LS's job. Many Laravel apps that bill through Stripe turn on Cashier's tax helpers, and that is exactly what breaks under Managed Payments. In Cashier 16's source:
Cashier::calculateTaxes()(usually called inAppServiceProvider) makesCheckoutBuilderaddautomatic_taxandtax_id_collection.->collectTaxIds()addstax_id_collection[enabled]=true.- If tax ID collection is on and the user already has a Stripe customer,
Checkout::create()also addscustomer_update[name]=autoandbilling_address_collection=required. taxRates()/priceTaxRates()on your billable model put tax rates on subscriptions.
automatic_tax, tax_id_collection, customer_update[name], customer_update[address] and subscription_data.default_tax_rates as unsupported in a Managed Payments session. Stripe calculates and remits the tax itself. See the full list with alternatives on our Managed Payments unsupported-parameters page.
4. Migrated subscriptions: backfill, or paying users get locked out
Existing subscribers don't go through your new checkout. Lemon Squeezy moves them to your Stripe account through the Migration Hub. At that point:
- Lemon Squeezy sends
subscription_migrated, whosedata.attributes.statususually readsexpired. Thelemonsqueezy/laravelpackage has no handler for this event. If Lemon Squeezy also sends an update that marks the subscription expired, your row flips and$user->subscribed()on the LS side turns false. - Migration doesn’t trigger a charge (so the first
invoice.paidarrives at the next renewal), and Stripe creates the subscription for a customer ID Cashier doesn’t know yet (details on our webhooks page). - Cashier's
WebhookControllerfinds the user withCashier::findBillable($customerId), which looks upusers.stripe_id. For migrated users that column is stillNULL, so even the nextcustomer.subscription.updatedrenewal is accepted with HTTP 200 and silently does nothing.
The result: someone who is paying passes neither check. The fix is a one-off backfill, run once per migration batch, from the subscription_migrated payload (meta.migration.stripe_customer_id, meta.migration.stripe_subscription_id) or from the Migration Hub subscription mapping report (ls_subscription_id, stripe_subscription_id, stripe_customer_id, migration_status):
// Sketch: not run against live Stripe. Artisan command body.
use Laravel\Cashier\Cashier;
use LemonSqueezy\Laravel\Subscription as LsSubscription;
foreach ($mappingRows as $row) { // rows where migration_status === 'migrated'
$ls = LsSubscription::where('lemon_squeezy_id', $row['ls_subscription_id'])->first();
if (! $ls) { continue; }
$user = $ls->billable; // your User (or LegacyLemonSqueezyCustomer -> user)
$user->forceFill(['stripe_id' => $row['stripe_customer_id']])->save();
$s = Cashier::stripe()->subscriptions->retrieve($row['stripe_subscription_id']);
$single = count($s->items->data) === 1;
$sub = $user->subscriptions()->updateOrCreate(
['stripe_id' => $s->id],
[
'type' => $ls->type ?? 'default',
'stripe_status' => $s->status,
'stripe_price' => $single ? $s->items->data[0]->price->id : null,
'quantity' => $single ? $s->items->data[0]->quantity : null,
'trial_ends_at' => $s->trial_end ? now()->setTimestamp($s->trial_end) : null,
'ends_at' => $s->cancel_at ? now()->setTimestamp($s->cancel_at) : null,
]
);
foreach ($s->items->data as $item) {
$sub->items()->updateOrCreate(['stripe_id' => $item->id], [
'stripe_product' => $item->price->product,
'stripe_price' => $item->price->id,
'quantity' => $item->quantity,
]);
}
}
The column names (type, stripe_status, stripe_price, quantity, trial_ends_at, ends_at, and on items stripe_product, stripe_price, quantity) are the ones Cashier 16's own webhook handler writes. Once users.stripe_id is set, Cashier's customer.subscription.updated handler will also create a missing row (firstOrNew). But that event may not arrive until the next renewal, up to a billing period later, so don't wait for it. Also handle subscription_migrated in a listener on the package's WebhookReceived event (WebhookHandled doesn't fire for it), so new batches get backfilled automatically. Keep the mapping CSV import as the fallback, because Lemon Squeezy only retries a failed webhook twice.
Then gate your features on one helper rather than calling subscribed() directly:
// Sketch. During dual running: Cashier first, then the LS row.
public function hasActiveAccess(): bool
{
if ($this->subscribed('default')) { // Cashier
return true;
}
$ls = $this->lemonSqueezyCustomer?->subscription('default');
return $ls && $ls->valid() && $ls->status !== 'expired';
}
After each batch, test renewal and webhook handling on a few of the backfilled accounts. The Lemon Squeezy Cutover Kit ($9) has 10 end-to-end test scripts and a before-and-after reconciliation worksheet you fill in (active subscriptions, MRR and more).
5. Two Billable traits, one User model: a fatal error
LemonSqueezy\Laravel\Billable (through Concerns\ManagesSubscriptions and ManagesCheckouts) and Laravel\Cashier\Billable (through Concerns\ManagesSubscriptions and PerformsCharges) both define subscriptions(), subscription(), subscribed(), onTrial(), hasExpiredTrial(), onGenericTrial(), hasExpiredGenericTrial(), trialEndsAt() and checkout(). If you use both on one class without resolving these, PHP throws a fatal trait-collision error. Even with insteadof/as aliases, subscriptions() can only point at one table: the LS version is a morphMany on billable, the Cashier version a hasMany on user_id.
The cleanest approach while both run side by side:
- Put
Laravel\Cashier\BillableonUser. - Move
LemonSqueezy\Laravel\Billableto a smallLegacyLemonSqueezyCustomermodel thatbelongsToUser, and give User alemonSqueezyCustomer()relation. - Repoint the existing rows: update
billable_type/billable_idin the package's customer, subscription and order tables to the new model. Back up first. Note thatorder_refundedstill resolves the billable from the original checkout'scustom_data, which namesUser, not the new model. Replay a refund of an old order in test mode before relying on this; if you can't make it work, use the alternative below. - Remove the LS model and package after the last subscriber has migrated and refunds have settled.
The lazy alternative is to keep LS on User and put Cashier on a Team or BillingAccount model. That works too, as long as only one Billable sits on each class, you call Cashier::useCustomerModel(Team::class) so webhooks look up the right model, and you adjust Cashier's migrations (they assume user_id). The backfill above then targets the team, not $ls->billable.
6. Method and config map
| lemonsqueezy/laravel | Laravel Cashier (Stripe) | Note |
|---|---|---|
$user->checkout('variant_id') | $user->checkout(['price_id' => 1], [...]) / newSubscription()->checkout([...]) | Add managed_payments[enabled]. LS variants map to Stripe prices through the Hub product mapping report. |
subscribed('default', $variant) | subscribed('default', $price) | The second argument changes from LS variant ID to Stripe price ID. |
subscribedToVariant() | subscribedToPrice() / subscribedToProduct() | |
subscription()->onTrial(), onGracePeriod(), cancel(), resume(), swap() | Same names | Check argument types. LS: swap($productId, $variantId); Cashier: swap($priceId). |
customerPortalUrl() / redirectToCustomerPortal() | billingPortalUrl() / redirectToBillingPortal() | Under Managed Payments, buyers manage billing through Link. Read what replaces the LS portal. |
custom_data (billable_id, billable_type) | Cashier links through users.stripe_id; use metadata for anything else | See where custom_data goes in Stripe. |
/lemon-squeezy/webhook, LEMON_SQUEEZY_SIGNING_SECRET | /stripe/webhook, STRIPE_WEBHOOK_SECRET, php artisan cashier:webhook | Keep both routes live during migration. |
LEMON_SQUEEZY_API_KEY, LEMON_SQUEEZY_STORE | STRIPE_KEY, STRIPE_SECRET |
Sources: lmsqueezy/laravel (src/Billable.php, src/Concerns/*, src/Http/Controllers/WebhookController.php); laravel/cashier-stripe 16.x (src/Cashier.php, src/Checkout.php, src/CheckoutBuilder.php, src/Concerns/ManagesSubscriptions.php, src/Http/Controllers/WebhookController.php); Stripe Update a Checkout integration to use Managed Payments; Lemon Squeezy Digital fulfillment migration.
Related
See migrating LS webhooks to Stripe, replacing the LS customer portal, Managed Payments unsupported parameters, 11 Migration Hub gotchas, and the full LS migration checklist.
This page is free. The kit is the paperwork.
Everything above is the Laravel code side. The Lemon Squeezy Cutover Kit ($9, 10-page PDF) is what you fill in and send:
| This page (free) | Cutover Kit ($9) | |
|---|---|---|
| Official dates, rules, Hub traps | Linked | Yes, in one table, each with “what it means for you” |
| Route decision (Managed Payments / MP + add-ons / other provider) | No | 5-minute decision tree |
| Week-by-week schedule | No | 8-week plan for each route |
| Customer emails | No | 5 fill-in templates (heads-up, PayPal, India cards, last call, help page) |
| Test scripts | Backfill sketch | 10 end-to-end scripts with pass criteria |
| Worksheets | No | Link inventory, subscriber segmentation, reconciliation |
Read a sample: Template 1 (heads-up email)
Subject: A change to how [Product] billing works on [date]
Hi [name], Lemon Squeezy, which handles our payments, stops processing on 31 March 2027, so we’re moving billing to [new provider] on or around [confirmed date]. [Only if confirmed: Your plan, price and renewal date stay the same.] After the move your statement will show [exact descriptor], and you’ll manage billing at [where]. You may also get an official notice from [provider]. That one is genuine. Questions? Just reply to this email.
Instant PDF delivery via Getly. Pay by card, Apple/Google Pay, or USDT/USDC. Getly offers a 30-day refund request window. Selling from a country without Stripe? See Getting Paid Online Without Stripe ($7).