wip testing

This commit is contained in:
hackerESQ
2024-09-06 19:39:04 -05:00
parent 9a99686db1
commit 90262abffb
19 changed files with 193 additions and 92 deletions
-24
View File
@@ -2,12 +2,9 @@
namespace Database\Factories;
use App\Models\Team;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
use Laravel\Jetstream\Features;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
@@ -47,25 +44,4 @@ class UserFactory extends Factory
'email_verified_at' => null,
]);
}
/**
* Indicate that the user should have a personal team.
*/
public function withPersonalTeam(?callable $callback = null): static
{
if (! Features::hasTeamFeatures()) {
return $this->state([]);
}
return $this->has(
Team::factory()
->state(fn (array $attributes, User $user) => [
'name' => $user->name.'\'s Team',
'user_id' => $user->id,
'personal_team' => true,
])
->when(is_callable($callback), $callback),
'ownedTeams'
);
}
}