Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

baz007's avatar

Laravel Spark - Multiplan

Hey guys,

Is it possible to allow a user to subscribe to a base plan / package and also subscribe to multiple other add-ons? Such as disk space in GB's, add more users, take out a notification package etc.

I have a dig through documentation but didn't get anywhere. Any advice on how to achieve this with Spark will be greatly appreciated.

Thank you

0 likes
3 replies
naekobest's avatar

Ill bump this because id like to know that too

aakarim's avatar

I've had to heavily customise my Spark Classic in order to support multiplan subscriptions. You'll need to extend the [Team]Subscribed.php file so that you can actually register for the new plans. Then also the StripeWebhookController.php file so you can receive the updates from Stripe.

aakarim's avatar

If you switch to multiplan subscriptions none of the Vue components that deal with subscriptions will work because they expect provider_plan to be set. There are two options to get around this: 1) change your local Subscription model to return the provider_plan of the main 'plan' you want to run; OR 2) you can override the subscriptions mixin to use any plan id in the SubscriptionItem in Vue. I did the latter:

/**
 * This mixin overrides the mixin from Spark to support multiplan subscriptions.
 */
module.exports = {
  methods: {
    /**
     * Determine if the given plan is selected.
     */
    isActivePlan(plan) {
      return (
        this.activeSubscription
        && this.activeSubscription.items.find((i) => i.stripe_plan === plan.id)
      );
    },
  },
  computed: {
    /**
     * Get the active plan instance.
     *
     * OVERRIDE from the base component, so we can support multiplan
     */
    activePlan() {
      if (this.activeSubscription) {
        return _.find(this.plans, (plan) => this.activeSubscription.items.find(
          (i) => plan.id === i.stripe_plan,
        ));
      }
    },
  },
};

add this as a mixin to all the components that use the subscriptions mixin from Spark. Make sure it's overridden in the spark-components folder.

Please or to participate in this conversation.