@@ -14,7 +14,7 @@ |
||
| 14 | 14 | { |
| 15 | 15 | factory(Leaderboard::class, 5) |
| 16 | 16 | ->create() |
| 17 | - ->each(function (Leaderboard $leaderboard) { |
|
| 17 | + ->each(function(Leaderboard $leaderboard) { |
|
| 18 | 18 | $leaderboard->game_id = rand(1, 3); |
| 19 | 19 | }); |
| 20 | 20 | } |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | use Furic\Leaderboards\Http\Controllers\LeaderboardController; |
| 5 | 5 | |
| 6 | 6 | Route::prefix('api')->group(function() { |
| 7 | - Route::get('leaderboards/{id}', [LeaderboardController::class, 'show']); |
|
| 7 | + Route::get('leaderboards/{id}', [LeaderboardController::class, 'show']); |
|
| 8 | 8 | Route::get('leaderboards/{id}/current', [LeaderboardController::class, 'showCurrent']); |
| 9 | 9 | Route::get('leaderboards/{id}/score-sums', [LeaderboardController::class, 'showScoreSums']); |
| 10 | 10 | Route::get('leaderboards/{id}/highscores', [LeaderboardController::class, 'showHighscores']); |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | |
| 72 | 72 | public function getHighscoreRank($highscore) |
| 73 | 73 | { |
| 74 | - return $this->hasMany(LeaderboardScore::class)->filter(function ($score) { |
|
| 74 | + return $this->hasMany(LeaderboardScore::class)->filter(function($score) { |
|
| 75 | 75 | return $score['highscore'] > $highscore; |
| 76 | 76 | }); |
| 77 | 77 | } |