X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FProtocol.php;fp=app%2FModels%2FProtocol.php;h=67fb1cecbe0d95ada851375ae7a1598c8bb6967a;hb=b940ecdcd62df84881f4d4555801672155c9dcce;hp=440aa0bec631e877901c80bff870abf921939ac7;hpb=2e5df98b0b4ef3828b7764ff266b745b684a09ea;p=alttp.git diff --git a/app/Models/Protocol.php b/app/Models/Protocol.php index 440aa0b..67fb1ce 100644 --- a/app/Models/Protocol.php +++ b/app/Models/Protocol.php @@ -156,6 +156,18 @@ 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 tournamentLocked(Tournament $tournament, User $user = null) { $protocol = static::create([ 'tournament_id' => $tournament->id, @@ -168,7 +180,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,