the browser-facing portion of osu!
1<?php
2
3// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
4// See the LICENCE file in the repository root for full licence text.
5
6declare(strict_types=1);
7
8namespace Database\Factories;
9
10use App\Models\Team;
11use App\Models\User;
12
13class TeamFactory extends Factory
14{
15 protected $model = Team::class;
16
17 public function configure(): static
18 {
19 return $this->afterCreating(function (Team $team): void {
20 $team->members()->create(['user_id' => $team->leader_id]);
21 });
22 }
23
24 public function definition(): array
25 {
26 return [
27 'name' => fn () => $this->faker->name(),
28 'short_name' => fn () => $this->faker->domainWord(),
29 'leader_id' => User::factory(),
30 ];
31 }
32}