feat: skin grid info

This commit is contained in:
Rico van Zelst
2023-11-09 14:55:57 +01:00
parent 050c8c7975
commit c542a2421b
8 changed files with 275 additions and 8 deletions

View File

@@ -51,7 +51,25 @@ class ChampionSkinController extends Controller
*/
public function show(ChampionSkin $championSkin)
{
//
$skin = Cache::remember(
'championSkinShowCache' . $championSkin->slug,
60 * 60 * 8,
function () use ($championSkin) {
return $championSkin->load('champion', 'chromas');
}
);
$splashColor = Cache::remember(
'championSkinSplashColorCache' . $championSkin->slug,
60 * 60 * 24,
function () use ($championSkin) {
return getAverageColorFromImageUrl($championSkin->getSkinImageAttribute());
}
);
$skin->splash_color = $splashColor;
return view('skins.show', compact('skin'));
}
/**