return $round->toJson();
}
+ public function update(Request $request, Round $round) {
+ $this->authorize('update', $round);
+
+ $validatedData = $request->validate([
+ 'code' => 'array',
+ 'code.*' => 'string',
+ 'seed' => 'url',
+ 'title' => 'string',
+ ]);
+
+ $round->code = array_filter($validatedData['code']);
+ $round->seed = $validatedData['seed'];
+ $round->title = $validatedData['title'];
+ $round->update();
+
+ Protocol::roundEdited(
+ $round->tournament,
+ $round,
+ $request->user(),
+ );
+
+ RoundChanged::dispatch($round);
+
+ $round->load(['results', 'results.user']);
+
+ return $round->toJson();
+ }
+
public function setSeed(Request $request, Round $round) {
$this->authorize('setSeed', $round);