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

myregistration's avatar

Laravel 8 - Teams

I was looking forward to Teams via Jetstream, but it's not what I expected. I seeded a user initially and it failed because I hadn't created a personal team for it. It appears every user must have at least a personal team. I don't understand why every user is required to be in or have a team. I'd prefer to make it optional so teams are only created using a desired subset of users. Any (easy) way around this? Thanks!

0 likes
5 replies
automica's avatar

@myregistration I would hazard its designed so a Team is like a Company. Even if you work for yourself you'll still have a Company.

myregistration's avatar

If you install the Team feature and decide you don't want to use it you can disable it by commenting it out in the jetstream.php config file.

2 likes
gabrielzambrano's avatar

I agree with @myregistration, it's a bit confusing. I don't understand why the system will automatically create a team per user. I see teams like a way of grouping users. Did you find out how to disable the creation of teams when an user is created

LaraLink's avatar

@myregistration @gabrielzambrano

App\Actions\Fortify\CreateNewUser.php

    return DB::transaction(function () use ($input) {
        return tap(User::create([
            'name' => $input['name'],
            'email' => $input['email'],
            'password' => Hash::make($input['password']),
        ]), function (User $user) {
            $this->createTeam($user);
        });

I'm assuming just remove the createTeam method call from the DB transaction. Now you'll have to remove/make some checks(unless it was fixed) in one(maybe more) of the view templates because its trying to get the current team from the user, which throws an exception I do believe

1 like
gabrielzambrano's avatar

Thanks @laralink. I wanted to use it in a seeder, I guess I'll just call this function (CreateNewUser from App\Actions\Fortify) rather than the normal User::create

        $user = new CreateNewUser();
        $user->create([
            'name'      => 'Name Lastname',
            'email'     => '[email protected]',
            'password'  => 'password',
            'password_confirmation' => 'password'
        ]);

Please or to participate in this conversation.