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

oscar_g__'s avatar

Limit an instance of Laravel Spark to a single team

Hello, I want to limit a deployment of Laravel Spark to a single team. That is - once a team has been registered on the website do not allow any more teams to be created. Is there a middleware I can create to stop more teams from being created?

0 likes
3 replies
Cronix's avatar

I think it would best from a users experience point of view to just hide the existing registration links/forms if Team::count() > 0. You don't want them to go through the hassle of filling out the registration form just to say they can't register.

oscar_g__'s avatar

@Cronix I do plan on hiding the links, but I don't want a user to manually type in "website.com/register" and register through that. I'd rather have a middleware that automatically redirects or throws a 400s error message.

Cronix's avatar

Ok, the middleware would still just have the same code as I posted above. It's a simple check?

Please or to participate in this conversation.