X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FHttp%2FControllers%2FRoundController.php;h=4938b3a04a0bac61c31ccd2d2ba49dd604d2209c;hb=d1f28ea443b090c7593791eba9631796ccaeafe1;hp=f7e70423f07a987689e03bc5ec15f69f64bc7da4;hpb=8b95f300549d865815d1a5b981844d1296898111;p=alttp.git diff --git a/app/Http/Controllers/RoundController.php b/app/Http/Controllers/RoundController.php index f7e7042..4938b3a 100644 --- a/app/Http/Controllers/RoundController.php +++ b/app/Http/Controllers/RoundController.php @@ -60,4 +60,42 @@ class RoundController extends Controller return $round->toJson(); } + public function lock(Request $request, Round $round) { + $this->authorize('lock', $round); + + $round->locked = true; + $round->update(); + + Protocol::roundLocked( + $round->tournament, + $round, + $request->user(), + ); + + RoundChanged::dispatch($round); + + $round->load('results'); + + return $round->toJson(); + } + + public function unlock(Request $request, Round $round) { + $this->authorize('unlock', $round); + + $round->locked = false; + $round->update(); + + Protocol::roundUnlocked( + $round->tournament, + $round, + $request->user(), + ); + + RoundChanged::dispatch($round); + + $round->load('results'); + + return $round->toJson(); + } + }