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

alanstorm's avatar

Turn on Team Billing in Laravel Spark

Is there known science for turning on Team Billing in Laravel Spark?

That is, if you want to use Laravel Spark's team billing features, you need to create your project with the team-billing option.

However, (hypothetically, he lied) if you didn't create your project with the --team-billing flag and suddenly needed the team billing features, is there a way to turn this on?

If not, is there a document list of the files you'd need to change?

I realize I could generate two new fresh projects, one with team billing and one without, and then diff the resulting projects to do this myself, but that seems an error prone route. I'd like to know if there's known science for this before heading down that path.

0 likes
7 replies
alanstorm's avatar

Thank you Cronix -- but I'm not sure those docs are complete. Some preliminary research also shows some differences in the SparkServiceProvider. So the docs aren't wrong, they just don't seem complete, so I'm going to leave this one open in case someone else has some real world experience with this.

Cronix's avatar

I have real world experience with Spark, and that's how I did it. The only difference when you do --team-billing when creating the project, is it adds that trait to the user model automatically.

alanstorm's avatar

Again, I appreciate the time/attention Cronix, and I belive you when you said that's all you did and it works. However, I just created two fresh projects and there's three differences in the SparkServiceProvider

Spark::useStripe()->noCardUpFront()->trialDays(10);
Spark::useStripe()->noCardUpFront()->teamTrialDays(10);

and

        Spark::freePlan()
            ->features([
                'First', 'Second', 'Third'
            ]);

        Spark::freeTeamPlan()
            ->features([
                'First', 'Second', 'Third'
            ]);

and

        Spark::plan('Basic', 'provider-id-1')
            ->price(10)
            ->features([
                'First', 'Second', 'Third'
            ]);

        Spark::teamPlan('Basic', 'provider-id-1')
            ->price(10)
            ->features([
                'First', 'Second', 'Third'
            ]);

Maybe that's something in an older/newer version of Spark.

alanstorm's avatar

@Cronix But those new plans you create still need to be setup with the teamTrialDays, freeTeamPlan, and teamPlan methods, right? i.e. if you only added the trait to the user object and left existing plans setup with trialDays, freePlan, and plan in place weird things might happen?

Or am I missing the boat completely on something?

Cronix's avatar

Depends on how you need it to work for your app. You can have individual user plans alongside team plans, or one or the other.

Please or to participate in this conversation.