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

mniblett's avatar

Spark: how to allow users to not belong to any teams?

Spark documentation states: However, by default, when a user does not belong to any teams, they will be redirected to a warning notice informing them that they should create a team to continue using the application. To view this notice, simply register a test user, delete all of their teams, and then attempt to access the application /home URI. This redirection is provided by the VerifyUserHasTeam middleware.

I'm confused as to where I would go to disable this behavior. I did find in app/http/kernal.php that VerifyUserHasTeam middleware is alias'd as 'hasTeam', but can't figure out where it's being applied.

Any help would be appreciated.

0 likes
1 reply
Braunson's avatar

It's in the VerifyUserHasTeam middleware. See https://github.com/laravel/spark-aurelius/blob/9.0/src/Http/Middleware/VerifyUserHasTeam.php

If Spark::usesTeams and the user doesn't have any teams, it'll redirect the user to /missing. You can try overriding or creating your own middleware that get's used in this instance.

It's being used in the install stubs that get copied to app/Http/Kernel.php .. see https://github.com/laravel/spark-aurelius/blob/2b4a4225c2045c27597c807f3e786803bed7b53a/install-stubs/app/Http/Kernel.php

Please or to participate in this conversation.