validate([ 'tournament_id' => 'required|exists:App\\Models\\Tournament,id', ]); $tournament = Tournament::findOrFail($validatedData['tournament_id']); $this->authorize('addRound', $tournament); $round = Round::create([ 'tournament_id' => $validatedData['tournament_id'], ]); Protocol::roundAdded( $tournament, $round, $request->user(), ); RoundAdded::dispatch($round); return $round->toJson(); } public function setSeed(Request $request, Round $round) { $this->authorize('setSeed', $round); $validatedData = $request->validate([ 'seed' => 'required|url', ]); $round->seed = $validatedData['seed']; $round->update(); Protocol::roundSeedSet( $round->tournament, $round, $request->user(), ); RoundChanged::dispatch($round); $round->load('results'); return $round->toJson(); } }