X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FProtocol.php;h=60b25f2ad8cd6cd21c4003fc747e40c808e1b132;hb=e1ecc76c1c6d527502d6576ee19be06df2a15bb7;hp=b747b1258d147472ad0a158d97f80e319f915943;hpb=d518ede5ffe8d4e44b0194279a9f32839bc1f903;p=alttp.git diff --git a/app/Models/Protocol.php b/app/Models/Protocol.php index b747b12..60b25f2 100644 --- a/app/Models/Protocol.php +++ b/app/Models/Protocol.php @@ -217,6 +217,18 @@ class Protocol extends Model ProtocolAdded::dispatch($protocol); } + public static function tournamentSettings(Tournament $tournament, User $user = null) { + $protocol = static::create([ + 'tournament_id' => $tournament->id, + 'user_id' => $user ? $user->id : null, + 'type' => 'tournament.settings', + 'details' => [ + 'tournament' => static::tournamentMemo($tournament), + ], + ]); + ProtocolAdded::dispatch($protocol); + } + public static function tournamentUnlocked(Tournament $tournament, User $user = null) { $protocol = static::create([ 'tournament_id' => $tournament->id,