feat: position filter

This commit is contained in:
Rico van Zelst
2023-11-08 21:40:51 +01:00
parent c7eae5d41a
commit 00018878e0
5 changed files with 68 additions and 8 deletions

View File

@@ -51,9 +51,13 @@ class ChampionController extends Controller
return $champion->load('skins', 'lanes');
});
$splashColor = Cache::remember('championSplashColorCache' . $champion->slug, 60 * 60 * 24, function () use ($champion) {
return getAverageColorFromImageUrl($champion->getChampionImageAttribute());
});
$splashColor = Cache::remember(
'championSplashColorCache' . $champion->slug,
60 * 60 * 24,
function () use ($champion) {
return getAverageColorFromImageUrl($champion->getChampionImageAttribute());
}
);
$champion->splash_color = $splashColor;