]> git.localhorst.tv Git - alttp.git/blobdiff - app/Models/Protocol.php
tournament settings
[alttp.git] / app / Models / Protocol.php
index 67fb1cecbe0d95ada851375ae7a1598c8bb6967a..9aaa5b08d1a8f5b519350ffa0ee2f85fd24543c1 100644 (file)
@@ -168,6 +168,18 @@ class Protocol extends Model
                ProtocolAdded::dispatch($protocol);
        }
 
+       public static function tournamentDiscordSettings(Tournament $tournament, User $user = null) {
+               $protocol = static::create([
+                       'tournament_id' => $tournament->id,
+                       'user_id' => $user ? $user->id : null,
+                       'type' => 'tournament.discordSettings',
+                       'details' => [
+                               'tournament' => static::tournamentMemo($tournament),
+                       ],
+               ]);
+               ProtocolAdded::dispatch($protocol);
+       }
+
        public static function tournamentLocked(Tournament $tournament, User $user = null) {
                $protocol = static::create([
                        'tournament_id' => $tournament->id,