Laravel Spark订阅名称显示异常:Stripe计划名称未同步
I’ve run into this exact issue before when setting up Spark with Stripe subscriptions, so let me walk you through the most common fixes:
Double-check your Spark plan configuration
First, head toconfig/spark.phpand verify theplansarray. Each plan must have anameset to your desired display text (like "Enterprise - Monthly") and aprovider_planthat exactly matches the plan ID in your Stripe dashboard. Even a tiny typo here will cause Spark to fall back to "default" because it can’t match the Stripe plan to your local config. Example correct config:'plans' => [ [ 'name' => 'Enterprise - Monthly', 'provider_plan' => 'my-enterprise-monthly', // Must match Stripe plan ID 'price' => 99, 'type' => 'monthly', // Other required fields... ], ],Sync subscriptions manually
If you created subscriptions through Stripe directly (not via your Spark app), Spark might not have pulled in the correct plan name. Run this Artisan command to force a sync between Stripe and your app’s database:php artisan spark:sync-subscriptionsThis will update all existing subscriptions with the name from your local Spark plan config if the
provider_planmatches.Verify Stripe Webhook setup
Make sure you’ve configured Stripe to sendcustomer.subscription.createdandcustomer.subscription.updatedevents to your Spark app’s webhook endpoint (/spark/webhook). If these webhooks aren’t firing or are failing, Spark won’t automatically update subscription details when changes happen in Stripe. Check Stripe’s Webhook Logs to confirm events are being delivered successfully.Manually update existing subscriptions (temporary fix)
For immediate relief, you can directly update thenamefield in yoursubscriptionsdatabase table. Find the subscription record withname = 'default'and set it to your desired plan name. Note: This is a band-aid—you’ll want to fix the root cause (either config or sync) to prevent future subscriptions from having the same issue.Check Spark’s subscription creation logic
If new subscriptions are still showing "default", ensure that when users subscribe via your app, Spark is correctly mapping the selected plan to the local config. Sometimes custom subscription flows can bypass Spark’s built-in logic, so double-check any custom code you’ve added around subscription creation.
内容的提问来源于stack exchange,提问作者Joshua Foxworth

