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
6namespace Database\Factories;
7
8use App\Models\BeatmapsetEvent;
9
10class BeatmapsetEventFactory extends Factory
11{
12 protected $model = BeatmapsetEvent::class;
13
14 public function configure()
15 {
16 return $this->afterCreating(function (BeatmapsetEvent $event) {
17 if ($event->type === BeatmapsetEvent::NOMINATE) {
18 $event->beatmapset->beatmapsetNominations()->create([
19 'event_id' => $event->getKey(),
20 'modes' => $event['comment']['modes'],
21 'user_id' => $event->user_id,
22 ]);
23 }
24 });
25 }
26
27 public function definition()
28 {
29 return [];
30 }
31}