mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-24 12:09:02 -05:00
fix: featured torrents slider query
- use eager loading on user relation to avoid N+1
This commit is contained in:
@@ -109,7 +109,7 @@ class HomeController extends Controller
|
||||
$groups = \cache()->remember('user-groups', $expiresAt, fn () => Group::select(['name', 'color', 'effect', 'icon'])->oldest('position')->get());
|
||||
|
||||
// Featured Torrents Block
|
||||
$featured = \cache()->remember('latest_featured', $expiresAt, fn () => FeaturedTorrent::with('torrent')->get());
|
||||
$featured = \cache()->remember('latest_featured', $expiresAt, fn () => FeaturedTorrent::with('torrent', 'user')->get());
|
||||
|
||||
// Latest Poll Block
|
||||
$poll = \cache()->remember('latest_poll', $expiresAt, fn () => Poll::latest()->first());
|
||||
|
||||
Reference in New Issue
Block a user