]> git.localhorst.tv Git - alttp.git/blobdiff - app/Models/Protocol.php
lock tournaments
[alttp.git] / app / Models / Protocol.php
index fee8b881b492b0e0739df1289d3cde53c7575a19..5b871f43a71d87adbc8170963b89bd46629f39a4 100644 (file)
@@ -74,6 +74,18 @@ class Protocol extends Model
                ProtocolAdded::dispatch($protocol);
        }
 
+       public static function tournamentLocked(Tournament $tournament, User $user = null) {
+               $protocol = static::create([
+                       'tournament_id' => $tournament->id,
+                       'user_id' => $user ? $user->id : null,
+                       'type' => 'tournament.lock',
+                       'details' => [
+                               'tournament' => static::tournamentMemo($tournament),
+                       ],
+               ]);
+               ProtocolAdded::dispatch($protocol);
+       }
+
 
        protected static function resultMemo(Result $result) {
                return [