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

kylehudson's avatar

Limit to single team

Hi guys,

I need to limit the teams to a single team, I also need to remove the ability to create new teams (from the nav). My subscriptions are as following:

public function booted()
    {
        Spark::useStripe()->noCardUpFront()->teamTrialDays(10);
        /*
        Spark::freeTeamPlan()
            ->maxTeamMembers(1)
            ->maxTeams(0)
            ->features([
                'First', 'Second', 'Third'
            ]);
        */
        Spark::teamPlan('Basic', 'provider-id-1')
            ->price(10)
            ->maxTeamMembers(5)
            ->maxTeams(1)
            ->features([
                'First', 'Second', 'Third'
            ]);

        Spark::teamPlan('Pro', 'provider-id-2')
            ->price(20)
            ->maxTeamMembers(5)
            ->maxTeams(3)
            ->features([
                'First', 'Second', 'Third'
            ]);
    }
0 likes
4 replies
EventFellows's avatar

It should work out of the box. I see a message "Please upgrade your subscription to create more teams." if i try to add more teams than should be allowed.

nickryall's avatar

I've noticed there is a bug where if the user is still on the trial period they can create as many teams as they want. However once the subscription officially starts the maxTeams() setting begins to work and I see the same behaviour that @EventFellows mentions above.

Update I realised what I describe above is not a bug. The user will be on the default Free Plan while on the trial period if no credit card is used up front. So the maxTeams() setting will need to be set on the free plan.

As far as removing the UI elements for creating new Teams, you could use this blade directive https://gist.github.com/dillinghamio/9b79dfab580d0f46971782ef9204e507 then conditionally display elements based on the user's current plan.

e.g. To hide the 'create team' panel for 'Basic users', you would change line 4 of /resources/views/vendor/spark/settings/teams.blade.php to:

<!-- Create Team -->
 @plan('Pro')
     @include('spark::settings.teams.create-team')
 @endplan
redenz's avatar

Don't use team billing. If you do it won't restrict the number of teams you can create. Instead use Spark:plan() and then use the CanJoinTeams in your user model. I found that Spark::teamPlan() does not enforce the maxTeams() method.

Please or to participate in this conversation.