X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FHttp%2FControllers%2FRoundController.php;fp=app%2FHttp%2FControllers%2FRoundController.php;h=f7e70423f07a987689e03bc5ec15f69f64bc7da4;hb=8b95f300549d865815d1a5b981844d1296898111;hp=d884d544bb22f5bd728e5e2f24859ab81ea6647e;hpb=2110d91bc5016fd78aec02578b09506b6d67f45e;p=alttp.git diff --git a/app/Http/Controllers/RoundController.php b/app/Http/Controllers/RoundController.php index d884d54..f7e7042 100644 --- a/app/Http/Controllers/RoundController.php +++ b/app/Http/Controllers/RoundController.php @@ -19,7 +19,10 @@ class RoundController extends Controller $tournament = Tournament::findOrFail($validatedData['tournament_id']); $this->authorize('addRound', $tournament); + $tournament->loadMax('rounds', 'number'); + $round = Round::create([ + 'number' => intval($tournament->rounds_max_number) + 1, 'tournament_id' => $validatedData['tournament_id'], ]);