X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FProtocol.php;h=9aaa5b08d1a8f5b519350ffa0ee2f85fd24543c1;hb=f446d5bcf3b87bd9443a060e27e9c0601c96fbb9;hp=440aa0bec631e877901c80bff870abf921939ac7;hpb=43da6b2ec78774e7b045a09c68af39717b5f5dbc;p=alttp.git diff --git a/app/Models/Protocol.php b/app/Models/Protocol.php index 440aa0b..9aaa5b0 100644 --- a/app/Models/Protocol.php +++ b/app/Models/Protocol.php @@ -156,6 +156,30 @@ class Protocol extends Model ProtocolAdded::dispatch($protocol); } + public static function tournamentDiscord(Tournament $tournament, User $user = null) { + $protocol = static::create([ + 'tournament_id' => $tournament->id, + 'user_id' => $user ? $user->id : null, + 'type' => 'tournament.discord', + 'details' => [ + 'tournament' => static::tournamentMemo($tournament), + ], + ]); + 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, @@ -168,7 +192,7 @@ class Protocol extends Model ProtocolAdded::dispatch($protocol); } - public static function tournamentOpenen(Tournament $tournament, User $user = null) { + public static function tournamentOpened(Tournament $tournament, User $user = null) { $protocol = static::create([ 'tournament_id' => $tournament->id, 'user_id' => $user ? $user->id : null,