namespace App\Http\Controllers;
use App\Events\RoundAdded;
+use App\Events\RoundChanged;
use App\Models\Protocol;
use App\Models\Round;
use App\Models\Tournament;
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();
+ }
+
}