Skip to content

Commit 9991252

Browse files
Show recent challenge contributors instead of random; bump PHP platform to 8.3 and update lockfile
- Replace inRandomOrder() with orderBy('challenge_user.created_at', 'desc') in HomeController and ChallengeRepository so avatars/submissions and challenge user lists show most-recent contributors consistently (works with cached home content). - Add PHP 8.3.0 to composer.json "platform" and regenerate composer.lock to reflect dependency updates and platform-overrides.
1 parent 40242b4 commit 9991252

4 files changed

Lines changed: 659 additions & 667 deletions

File tree

app/Http/Controllers/HomeController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function index()
8888
'users.is_admin'
8989
)
9090
->whereNotNull('avatar_url')
91-
->inRandomOrder()
91+
->orderBy('challenge_user.created_at', 'desc')
9292
->limit(5);
9393
}, // nao ordena por usuário logado pois informaçoes estão cacheadas
9494
])

app/Services/ChallengeRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function challengeCardsBaseQuery($query, $currentUser)
4545
$currentUser->id,
4646
]);
4747
})
48-
->inRandomOrder()
48+
->orderBy('challenge_user.created_at', 'desc')
4949
->limit(5);
5050
},
5151
]);

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@
9292
"optimize-autoloader": true,
9393
"preferred-install": "dist",
9494
"sort-packages": true,
95+
"platform": {
96+
"php": "8.3.0"
97+
},
9598
"allow-plugins": {
9699
"pestphp/pest-plugin": true,
97100
"php-http/discovery": true

0 commit comments

Comments
 (0)