return $user->toJson();
}
+ public function setNickname(Request $request, User $user) {
+ $this->authorize('setNickname', $user);
+
+ $validatedData = $request->validate([
+ 'nickname' => 'string',
+ ]);
+
+ $user->nickname = $validatedData['nickname'];
+ $user->update();
+
+ UserChanged::dispatch($user);
+
+ return $user->toJson();
+ }
+
public function setStreamLink(Request $request, User $user) {
$this->authorize('setStreamLink', $user);
$this->authorize('view', $user);
$user->load('participation');
$user->load('participation.tournament');
+ $user->loadCount('round_first');
+ $user->loadCount('round_second');
+ $user->loadCount('round_third');
+ $user->loadCount('tournament_first');
+ $user->loadCount('tournament_second');
+ $user->loadCount('tournament_third');
return $user->toJson();
}