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\Multiplayer;
9
10use App\Models\Beatmap;
11use App\Models\Multiplayer\PlaylistItem;
12use App\Models\Multiplayer\Room;
13use App\Models\User;
14use Database\Factories\Factory;
15
16class PlaylistItemFactory extends Factory
17{
18 protected $model = PlaylistItem::class;
19
20 public function definition(): array
21 {
22 return [
23 'beatmap_id' => Beatmap::factory(),
24 'room_id' => Room::factory(),
25 'ruleset_id' => fn(array $attributes) => Beatmap::find($attributes['beatmap_id'])->playmode,
26 'allowed_mods' => [],
27 'required_mods' => [],
28 'owner_id' => User::factory(),
29 ];
30 }
31}