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

bhalliburton's avatar

Require selecting a plan when creating a new Team

I am using team billing and I don't have a free plan option for teams. In fact, I only have one plan at the moment:

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

When users are logged in and they look at the "Teams" section of the settings pull-down, they have the option to create a team, but the team, upon creation, is not assigned to a plan.

I want to force them to sign up for a plan when they go to create a team, which is consistent with the "no free plan option". Is there a "Spark"-ish way to do this?

0 likes
4 replies
ahuggins's avatar

I am assuming you are using the No card up front option?

I would guess you could make a middleware, that checks if the created team has a plan...if not redirect the user to a page that requires sign up for a plan. Then just make sure the middleware is applied on the appropriate routes.

That would be my initial take based on info provided, but hard to know if that is suitable for your situation.

1 like
bhalliburton's avatar

No, I require the card up front. :-/ There is no free plan.

So a user comes in, signs up for a plan, enters his credit card, then has the option to add a new team, but needs to sign that team up for a plan in the process of creating it.

Appreciate the ideas, though!

ahuggins's avatar

So the individual user is on a plan of his own...then creates a team with a separate plan?

Is that basically a feature that allows him to have collaborators and that's what the team plan covers?

bhalliburton's avatar

I am using Team Billing with no free plan and no trial (per the code above). When you look at the user menu, it looks like this:

Menu

When you go to the "Create Team" option, it looks like this:

Create Teams

When you click on a Teams settings in this menu, you see this:

Team Settings

So people are able to create teams without having them assigned to a team plan at all. That seems like the wrong user experience. When they create a new team, I would like them to have to choose a plan to create the team. Wondering if there is some secretly best way to do this or if I should just start hackin'.

Does that make sense?

Please or to participate in this conversation.