feat: champ information, style improvement

This commit is contained in:
Rico van Zelst
2023-11-08 14:12:51 +01:00
parent b0a88ba3b9
commit 149174ebc3
11 changed files with 299 additions and 24 deletions

View File

@@ -51,6 +51,12 @@ 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());
});
$champion->splash_color = $splashColor;
return view('champions.show', compact('champion'));
}