X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FModels%2FProtocol.php;h=b747b1258d147472ad0a158d97f80e319f915943;hb=212561cf1c6724b52c490104f5a2b4c3418b1c62;hp=9aaa5b08d1a8f5b519350ffa0ee2f85fd24543c1;hpb=f446d5bcf3b87bd9443a060e27e9c0601c96fbb9;p=alttp.git diff --git a/app/Models/Protocol.php b/app/Models/Protocol.php index 9aaa5b0..b747b12 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, @@ -275,6 +288,7 @@ class Protocol extends Model protected $casts = [ 'details' => 'array', + 'user_id' => 'string', ]; protected $fillable = [