X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FProtocol.php;h=ce081e77dded2c6bf7f92af76381d1a0364e54e6;hb=4f4b2fd64141cbbff953881e2705602a00b85df5;hp=67fb1cecbe0d95ada851375ae7a1598c8bb6967a;hpb=b940ecdcd62df84881f4d4555801672155c9dcce;p=alttp.git diff --git a/app/Models/Protocol.php b/app/Models/Protocol.php index 67fb1ce..ce081e7 100644 --- a/app/Models/Protocol.php +++ b/app/Models/Protocol.php @@ -93,6 +93,19 @@ class Protocol extends Model ProtocolAdded::dispatch($protocol); } + public static function roundEdited(Tournament $tournament, Round $round, User $user) { + $protocol = static::create([ + 'tournament_id' => $tournament->id, + 'user_id' => $user->id, + 'type' => 'round.edit', + 'details' => [ + 'tournament' => static::tournamentMemo($tournament), + 'round' => static::roundMemo($round), + ], + ]); + ProtocolAdded::dispatch($protocol); + } + public static function roundLocked(Tournament $tournament, Round $round, User $user = null) { $protocol = static::create([ 'tournament_id' => $tournament->id, @@ -168,6 +181,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,