]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/RoundController.php
autonumber rounds
[alttp.git] / app / Http / Controllers / RoundController.php
index d884d544bb22f5bd728e5e2f24859ab81ea6647e..f7e70423f07a987689e03bc5ec15f69f64bc7da4 100644 (file)
@@ -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'],
                ]);