fix: featured torrents slider query

- use eager loading on user relation to avoid N+1
This commit is contained in:
HDVinnie
2022-06-08 23:46:56 -04:00
parent eff08c4d5a
commit 92fb549ec6
+1 -1
View File
@@ -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());