1 | <?php |
||
12 | class RoomsController extends BaseController |
||
13 | { |
||
14 | /** |
||
15 | * Get LeaderBoard Data. |
||
16 | * |
||
17 | * @TODO: Make Possible Filter with all the Possible Criteria |
||
18 | * |
||
19 | * @param string $countryId |
||
20 | * @param string $roomRange |
||
21 | * @param string $roomInterval |
||
22 | * |
||
23 | * @return JsonResponse |
||
24 | */ |
||
25 | public function getLeader($countryId, $roomRange, $roomInterval): JsonResponse |
||
26 | { |
||
27 | $leaderRank = 1; |
||
28 | |||
29 | foreach (($leaderBoard = Room::where('state', '!=', 'invisible')->orderBy('score', 'DESC')->orderBy('users', 'DESC')->limit(50)->get()) as $room) { |
||
30 | $room->leaderboardRank = $leaderRank++; |
||
31 | } |
||
32 | |||
33 | return response()->json($leaderBoard, 200, [], JSON_UNESCAPED_SLASHES); |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * Get a specific Room Data. |
||
38 | * |
||
39 | * @param int $roomId |
||
40 | * |
||
41 | * @return JsonResponse |
||
42 | */ |
||
43 | public function getRoom($roomId): JsonResponse |
||
47 | } |
||
48 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.