This commit is contained in:
Rico van Zelst
2024-01-18 00:06:24 +01:00
4 changed files with 87 additions and 79 deletions

View File

@@ -17,9 +17,9 @@ class ChampionController extends Controller
{
$eightHoursInSeconds = 60 * 60 * 8;
$champions = Cache::remember('championsListAllCache', $eightHoursInSeconds, static fn() => Champion::orderBy('name')->get());
$champions = Cache::remember('championsListAllCache', $eightHoursInSeconds, static fn () => Champion::orderBy('name')->get());
$roles = Cache::remember('championsRolesCache', $eightHoursInSeconds, static fn() => ChampionRoles::orderBy('champion_name')->get());
$roles = Cache::remember('championsRolesCache', $eightHoursInSeconds, static fn () => ChampionRoles::orderBy('champion_name')->get());
return view('champions.index', ['champions' => $champions, 'roles' => $roles]);
}
@@ -48,12 +48,12 @@ class ChampionController extends Controller
$threeDaysInSeconds = 60 * 60 * 24 * 3;
$sixMonthsInSeconds = 60 * 60 * 24 * 30 * 6;
$champion = Cache::remember('championShowCache' . $champion->slug, $threeDaysInSeconds, static fn() => $champion->load('skins', 'lanes'));
$champion = Cache::remember('championShowCache' . $champion->slug, $threeDaysInSeconds, static fn () => $champion->load('skins', 'lanes'));
$splashColor = Cache::remember(
'championSplashColorCache' . $champion->slug,
$sixMonthsInSeconds,
static fn() => getAverageColorFromImageUrl($champion->getChampionImageAttribute())
static fn () => getAverageColorFromImageUrl($champion->getChampionImageAttribute())
);
$champion->splash_color = $splashColor;

View File

@@ -57,13 +57,13 @@ class ChampionSkinController extends Controller
$skin = Cache::remember(
'championSkinShowCache' . $championSkin->slug,
60 * 60 * 48,
static fn() => $championSkin->load('champion', 'chromas')
static fn () => $championSkin->load('champion', 'chromas')
);
$splashColor = Cache::remember(
'championSkinSplashColorCache' . $championSkin->slug,
60 * 60 * 120,
static fn() => getAverageColorFromImageUrl($championSkin->getSkinImageAttribute())
static fn () => getAverageColorFromImageUrl($championSkin->getSkinImageAttribute())
);
$skin->splash_color = $splashColor;

View File

@@ -24,7 +24,7 @@
"laravel/tinker": "^2.8",
"league/flysystem-aws-s3-v3": "^3.0",
"saade/blade-iconsax": "^1.1",
"simonhamp/the-og": "^0.2.2",
"simonhamp/the-og": "^0.4.0",
"spatie/laravel-backup": "^8.3",
"spatie/laravel-query-builder": "^5.6",
"spatie/sheets": "^1.10",

152
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "b911118ecb3088a07b792a244ee4bf7b",
"content-hash": "4aad231dd714f9e0f4e8544098ca6221",
"packages": [
{
"name": "andcarpi/laravel-popper",
@@ -1969,16 +1969,16 @@
},
{
"name": "intervention/image",
"version": "3.2.2",
"version": "3.2.4",
"source": {
"type": "git",
"url": "https://github.com/Intervention/image.git",
"reference": "71bb0e3449bbbfdf47a0d0f2860af7e5e90428e6"
"reference": "e04c51b367fad2b010758e74528041484cd8d2f7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Intervention/image/zipball/71bb0e3449bbbfdf47a0d0f2860af7e5e90428e6",
"reference": "71bb0e3449bbbfdf47a0d0f2860af7e5e90428e6",
"url": "https://api.github.com/repos/Intervention/image/zipball/e04c51b367fad2b010758e74528041484cd8d2f7",
"reference": "e04c51b367fad2b010758e74528041484cd8d2f7",
"shasum": ""
},
"require": {
@@ -1991,6 +1991,9 @@
"phpstan/phpstan": "^1",
"phpunit/phpunit": "^9"
},
"suggest": {
"ext-exif": "Recommended to be able to read EXIF data properly."
},
"type": "library",
"autoload": {
"psr-4": {
@@ -2020,7 +2023,7 @@
],
"support": {
"issues": "https://github.com/Intervention/image/issues",
"source": "https://github.com/Intervention/image/tree/3.2.2"
"source": "https://github.com/Intervention/image/tree/3.2.4"
},
"funding": [
{
@@ -2032,7 +2035,7 @@
"type": "github"
}
],
"time": "2024-01-07T09:11:20+00:00"
"time": "2024-01-14T07:47:00+00:00"
},
{
"name": "laminas/laminas-diactoros",
@@ -2121,16 +2124,16 @@
},
{
"name": "laravel/framework",
"version": "v10.39.0",
"version": "v10.40.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "114926b07bfb5fbf2545c03aa2ce5c8c37be650c"
"reference": "7a9470071dac9579ebf29ad1b9d73e4b8eb586fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/114926b07bfb5fbf2545c03aa2ce5c8c37be650c",
"reference": "114926b07bfb5fbf2545c03aa2ce5c8c37be650c",
"url": "https://api.github.com/repos/laravel/framework/zipball/7a9470071dac9579ebf29ad1b9d73e4b8eb586fc",
"reference": "7a9470071dac9579ebf29ad1b9d73e4b8eb586fc",
"shasum": ""
},
"require": {
@@ -2322,7 +2325,7 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2023-12-27T14:26:28+00:00"
"time": "2024-01-09T11:46:47+00:00"
},
{
"name": "laravel/octane",
@@ -2414,16 +2417,16 @@
},
{
"name": "laravel/prompts",
"version": "v0.1.14",
"version": "v0.1.15",
"source": {
"type": "git",
"url": "https://github.com/laravel/prompts.git",
"reference": "2219fa9c4b944add1e825c3bdb8ecae8bc503bc6"
"reference": "d814a27514d99b03c85aa42b22cfd946568636c1"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/prompts/zipball/2219fa9c4b944add1e825c3bdb8ecae8bc503bc6",
"reference": "2219fa9c4b944add1e825c3bdb8ecae8bc503bc6",
"url": "https://api.github.com/repos/laravel/prompts/zipball/d814a27514d99b03c85aa42b22cfd946568636c1",
"reference": "d814a27514d99b03c85aa42b22cfd946568636c1",
"shasum": ""
},
"require": {
@@ -2465,9 +2468,9 @@
],
"support": {
"issues": "https://github.com/laravel/prompts/issues",
"source": "https://github.com/laravel/prompts/tree/v0.1.14"
"source": "https://github.com/laravel/prompts/tree/v0.1.15"
},
"time": "2023-12-27T04:18:09+00:00"
"time": "2023-12-29T22:37:42+00:00"
},
{
"name": "laravel/pulse",
@@ -4750,16 +4753,16 @@
},
{
"name": "simonhamp/the-og",
"version": "v0.2.2",
"version": "v0.4.0",
"source": {
"type": "git",
"url": "https://github.com/simonhamp/the-og.git",
"reference": "2221ff4594baae5d381603be11b57205afa45934"
"reference": "bc4605d34594e86fbbcca4e90fef4d13faec2d70"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/simonhamp/the-og/zipball/2221ff4594baae5d381603be11b57205afa45934",
"reference": "2221ff4594baae5d381603be11b57205afa45934",
"url": "https://api.github.com/repos/simonhamp/the-og/zipball/bc4605d34594e86fbbcca4e90fef4d13faec2d70",
"reference": "bc4605d34594e86fbbcca4e90fef4d13faec2d70",
"shasum": ""
},
"require": {
@@ -4767,6 +4770,11 @@
"intervention/image": "^3.1",
"php": "^8.2"
},
"require-dev": {
"phpunit/phpunit": "^10.5",
"spatie/phpunit-snapshot-assertions": "^5.1.1",
"spatie/pixelmatch-php": "^1.0"
},
"type": "library",
"autoload": {
"psr-4": {
@@ -4786,7 +4794,7 @@
"description": "OpenGraph Image Generator for PHP",
"support": {
"issues": "https://github.com/simonhamp/the-og/issues",
"source": "https://github.com/simonhamp/the-og/tree/v0.2.2"
"source": "https://github.com/simonhamp/the-og/tree/v0.4.0"
},
"funding": [
{
@@ -4794,25 +4802,25 @@
"type": "github"
}
],
"time": "2024-01-06T01:22:40+00:00"
"time": "2024-01-13T04:43:50+00:00"
},
{
"name": "spatie/db-dumper",
"version": "3.4.0",
"version": "3.4.2",
"source": {
"type": "git",
"url": "https://github.com/spatie/db-dumper.git",
"reference": "bbd5ae0f331d47e6534eb307e256c11a65c8e24a"
"reference": "59beef7ad612ca7463dfddb64de6e038eb59e0d7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/db-dumper/zipball/bbd5ae0f331d47e6534eb307e256c11a65c8e24a",
"reference": "bbd5ae0f331d47e6534eb307e256c11a65c8e24a",
"url": "https://api.github.com/repos/spatie/db-dumper/zipball/59beef7ad612ca7463dfddb64de6e038eb59e0d7",
"reference": "59beef7ad612ca7463dfddb64de6e038eb59e0d7",
"shasum": ""
},
"require": {
"php": "^8.0",
"symfony/process": "^5.0|^6.0"
"symfony/process": "^5.0|^6.0|^7.0"
},
"require-dev": {
"pestphp/pest": "^1.22"
@@ -4845,7 +4853,7 @@
"spatie"
],
"support": {
"source": "https://github.com/spatie/db-dumper/tree/3.4.0"
"source": "https://github.com/spatie/db-dumper/tree/3.4.2"
},
"funding": [
{
@@ -4857,20 +4865,20 @@
"type": "github"
}
],
"time": "2023-06-27T08:34:52+00:00"
"time": "2023-12-25T11:42:15+00:00"
},
{
"name": "spatie/laravel-backup",
"version": "8.4.1",
"version": "8.5.0",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-backup.git",
"reference": "b79f790cc856e67cce012abf34bf1c9035085dc1"
"reference": "6d7740f2e4b353ab1e3c514c18ecbb53c71ec66c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-backup/zipball/b79f790cc856e67cce012abf34bf1c9035085dc1",
"reference": "b79f790cc856e67cce012abf34bf1c9035085dc1",
"url": "https://api.github.com/repos/spatie/laravel-backup/zipball/6d7740f2e4b353ab1e3c514c18ecbb53c71ec66c",
"reference": "6d7740f2e4b353ab1e3c514c18ecbb53c71ec66c",
"shasum": ""
},
"require": {
@@ -4893,10 +4901,10 @@
"require-dev": {
"composer-runtime-api": "^2.0",
"ext-pcntl": "*",
"larastan/larastan": "^2.7.0",
"laravel/slack-notification-channel": "^2.5",
"league/flysystem-aws-s3-v3": "^2.0|^3.0",
"mockery/mockery": "^1.4",
"nunomaduro/larastan": "^2.1",
"orchestra/testbench": "^8.0",
"pestphp/pest": "^1.20",
"phpstan/extension-installer": "^1.1",
@@ -4944,7 +4952,7 @@
],
"support": {
"issues": "https://github.com/spatie/laravel-backup/issues",
"source": "https://github.com/spatie/laravel-backup/tree/8.4.1"
"source": "https://github.com/spatie/laravel-backup/tree/8.5.0"
},
"funding": [
{
@@ -4956,24 +4964,24 @@
"type": "other"
}
],
"time": "2023-11-20T08:21:45+00:00"
"time": "2024-01-11T08:55:19+00:00"
},
{
"name": "spatie/laravel-package-tools",
"version": "1.16.1",
"version": "1.16.2",
"source": {
"type": "git",
"url": "https://github.com/spatie/laravel-package-tools.git",
"reference": "cc7c991555a37f9fa6b814aa03af73f88026a83d"
"reference": "e62eeb1fe8a8a0b2e83227a6c279c8c59f7d3a15"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/cc7c991555a37f9fa6b814aa03af73f88026a83d",
"reference": "cc7c991555a37f9fa6b814aa03af73f88026a83d",
"url": "https://api.github.com/repos/spatie/laravel-package-tools/zipball/e62eeb1fe8a8a0b2e83227a6c279c8c59f7d3a15",
"reference": "e62eeb1fe8a8a0b2e83227a6c279c8c59f7d3a15",
"shasum": ""
},
"require": {
"illuminate/contracts": "^9.28|^10.0",
"illuminate/contracts": "^9.28|^10.0|^11.0",
"php": "^8.0"
},
"require-dev": {
@@ -5008,7 +5016,7 @@
],
"support": {
"issues": "https://github.com/spatie/laravel-package-tools/issues",
"source": "https://github.com/spatie/laravel-package-tools/tree/1.16.1"
"source": "https://github.com/spatie/laravel-package-tools/tree/1.16.2"
},
"funding": [
{
@@ -5016,7 +5024,7 @@
"type": "github"
}
],
"time": "2023-08-23T09:04:39+00:00"
"time": "2024-01-11T08:43:00+00:00"
},
{
"name": "spatie/laravel-query-builder",
@@ -5247,16 +5255,16 @@
},
{
"name": "spatie/temporary-directory",
"version": "2.2.0",
"version": "2.2.1",
"source": {
"type": "git",
"url": "https://github.com/spatie/temporary-directory.git",
"reference": "efc258c9f4da28f0c7661765b8393e4ccee3d19c"
"reference": "76949fa18f8e1a7f663fd2eaa1d00e0bcea0752a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/spatie/temporary-directory/zipball/efc258c9f4da28f0c7661765b8393e4ccee3d19c",
"reference": "efc258c9f4da28f0c7661765b8393e4ccee3d19c",
"url": "https://api.github.com/repos/spatie/temporary-directory/zipball/76949fa18f8e1a7f663fd2eaa1d00e0bcea0752a",
"reference": "76949fa18f8e1a7f663fd2eaa1d00e0bcea0752a",
"shasum": ""
},
"require": {
@@ -5292,7 +5300,7 @@
],
"support": {
"issues": "https://github.com/spatie/temporary-directory/issues",
"source": "https://github.com/spatie/temporary-directory/tree/2.2.0"
"source": "https://github.com/spatie/temporary-directory/tree/2.2.1"
},
"funding": [
{
@@ -5304,7 +5312,7 @@
"type": "github"
}
],
"time": "2023-09-25T07:13:36+00:00"
"time": "2023-12-25T11:46:58+00:00"
},
{
"name": "spatie/yaml-front-matter",
@@ -9262,16 +9270,16 @@
},
{
"name": "laravel/pint",
"version": "v1.13.7",
"version": "v1.13.8",
"source": {
"type": "git",
"url": "https://github.com/laravel/pint.git",
"reference": "4157768980dbd977f1c4b4cc94997416d8b30ece"
"reference": "69def89df9e0babc0f0a8bea184804a7d8a9c5c0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/pint/zipball/4157768980dbd977f1c4b4cc94997416d8b30ece",
"reference": "4157768980dbd977f1c4b4cc94997416d8b30ece",
"url": "https://api.github.com/repos/laravel/pint/zipball/69def89df9e0babc0f0a8bea184804a7d8a9c5c0",
"reference": "69def89df9e0babc0f0a8bea184804a7d8a9c5c0",
"shasum": ""
},
"require": {
@@ -9282,13 +9290,13 @@
"php": "^8.1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.38.0",
"illuminate/view": "^10.30.1",
"friendsofphp/php-cs-fixer": "^3.46.0",
"illuminate/view": "^10.39.0",
"larastan/larastan": "^2.8.1",
"laravel-zero/framework": "^10.3.0",
"mockery/mockery": "^1.6.6",
"nunomaduro/larastan": "^2.6.4",
"mockery/mockery": "^1.6.7",
"nunomaduro/termwind": "^1.15.1",
"pestphp/pest": "^2.24.2"
"pestphp/pest": "^2.30.0"
},
"bin": [
"builds/pint"
@@ -9324,20 +9332,20 @@
"issues": "https://github.com/laravel/pint/issues",
"source": "https://github.com/laravel/pint"
},
"time": "2023-12-05T19:43:12+00:00"
"time": "2024-01-09T18:03:54+00:00"
},
{
"name": "laravel/sail",
"version": "v1.26.3",
"version": "v1.27.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/sail.git",
"reference": "fa1ad5fbb03686dfc752bfd1861d86091cc1c32d"
"reference": "65a7764af5daadbd122e3b0d67be371d158a9b9a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/sail/zipball/fa1ad5fbb03686dfc752bfd1861d86091cc1c32d",
"reference": "fa1ad5fbb03686dfc752bfd1861d86091cc1c32d",
"url": "https://api.github.com/repos/laravel/sail/zipball/65a7764af5daadbd122e3b0d67be371d158a9b9a",
"reference": "65a7764af5daadbd122e3b0d67be371d158a9b9a",
"shasum": ""
},
"require": {
@@ -9389,7 +9397,7 @@
"issues": "https://github.com/laravel/sail/issues",
"source": "https://github.com/laravel/sail"
},
"time": "2023-12-02T18:26:39+00:00"
"time": "2024-01-03T14:07:34+00:00"
},
{
"name": "maximebf/debugbar",
@@ -9861,16 +9869,16 @@
},
{
"name": "phpdocumentor/type-resolver",
"version": "1.7.3",
"version": "1.8.0",
"source": {
"type": "git",
"url": "https://github.com/phpDocumentor/TypeResolver.git",
"reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419"
"reference": "fad452781b3d774e3337b0c0b245dd8e5a4455fc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419",
"reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419",
"url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fad452781b3d774e3337b0c0b245dd8e5a4455fc",
"reference": "fad452781b3d774e3337b0c0b245dd8e5a4455fc",
"shasum": ""
},
"require": {
@@ -9913,9 +9921,9 @@
"description": "A PSR-5 based resolver of Class names, Types and Structural Element Names",
"support": {
"issues": "https://github.com/phpDocumentor/TypeResolver/issues",
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.3"
"source": "https://github.com/phpDocumentor/TypeResolver/tree/1.8.0"
},
"time": "2023-08-12T11:01:26+00:00"
"time": "2024-01-11T11:49:22+00:00"
},
{
"name": "phpstan/phpdoc-parser",