]> git.localhorst.tv Git - alttp.git/blobdiff - app/Http/Controllers/UserController.php
show placements on user profile
[alttp.git] / app / Http / Controllers / UserController.php
index c0ab73d9b442a30ff340375e97d4747b0e5e9a5f..692c45862feb0e21186862476cf9ff5a76e31bc8 100644 (file)
@@ -41,6 +41,14 @@ class UserController extends Controller
        public function single(Request $request, $id) {
                $user = User::findOrFail($id);
                $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();
        }