diff --git a/composer.lock b/composer.lock index 3f4c0de10..5be550823 100644 --- a/composer.lock +++ b/composer.lock @@ -493,16 +493,16 @@ }, { "name": "egulias/email-validator", - "version": "4.0.2", + "version": "4.0.3", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e" + "reference": "b115554301161fa21467629f1e1391c1936de517" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/ebaaf5be6c0286928352e054f2d5125608e5405e", - "reference": "ebaaf5be6c0286928352e054f2d5125608e5405e", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/b115554301161fa21467629f1e1391c1936de517", + "reference": "b115554301161fa21467629f1e1391c1936de517", "shasum": "" }, "require": { @@ -548,7 +548,7 @@ ], "support": { "issues": "https://github.com/egulias/EmailValidator/issues", - "source": "https://github.com/egulias/EmailValidator/tree/4.0.2" + "source": "https://github.com/egulias/EmailValidator/tree/4.0.3" }, "funding": [ { @@ -556,7 +556,7 @@ "type": "github" } ], - "time": "2023-10-06T06:47:41+00:00" + "time": "2024-12-27T00:36:43+00:00" }, { "name": "fruitcake/php-cors", @@ -1215,16 +1215,16 @@ }, { "name": "laravel/framework", - "version": "v11.35.1", + "version": "v11.36.1", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "dcfa130ede1a6fa4343dc113410963e791ad34fb" + "reference": "df06f5163f4550641fdf349ebc04916a61135a64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/dcfa130ede1a6fa4343dc113410963e791ad34fb", - "reference": "dcfa130ede1a6fa4343dc113410963e791ad34fb", + "url": "https://api.github.com/repos/laravel/framework/zipball/df06f5163f4550641fdf349ebc04916a61135a64", + "reference": "df06f5163f4550641fdf349ebc04916a61135a64", "shasum": "" }, "require": { @@ -1245,7 +1245,7 @@ "guzzlehttp/uri-template": "^1.0", "laravel/prompts": "^0.1.18|^0.2.0|^0.3.0", "laravel/serializable-closure": "^1.3|^2.0", - "league/commonmark": "^2.2.1", + "league/commonmark": "^2.6", "league/flysystem": "^3.25.1", "league/flysystem-local": "^3.25.1", "league/uri": "^7.5.1", @@ -1260,7 +1260,7 @@ "symfony/console": "^7.0.3", "symfony/error-handler": "^7.0.3", "symfony/finder": "^7.0.3", - "symfony/http-foundation": "^7.0.3", + "symfony/http-foundation": "^7.2.0", "symfony/http-kernel": "^7.0.3", "symfony/mailer": "^7.0.3", "symfony/mime": "^7.0.3", @@ -1426,7 +1426,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-12-12T18:25:58+00:00" + "time": "2024-12-17T22:32:08+00:00" }, { "name": "laravel/prompts", @@ -1489,16 +1489,16 @@ }, { "name": "laravel/serializable-closure", - "version": "v2.0.0", + "version": "v2.0.1", "source": { "type": "git", "url": "https://github.com/laravel/serializable-closure.git", - "reference": "0d8d3d8086984996df86596a86dea60398093a81" + "reference": "613b2d4998f85564d40497e05e89cb6d9bd1cbe8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/0d8d3d8086984996df86596a86dea60398093a81", - "reference": "0d8d3d8086984996df86596a86dea60398093a81", + "url": "https://api.github.com/repos/laravel/serializable-closure/zipball/613b2d4998f85564d40497e05e89cb6d9bd1cbe8", + "reference": "613b2d4998f85564d40497e05e89cb6d9bd1cbe8", "shasum": "" }, "require": { @@ -1546,7 +1546,7 @@ "issues": "https://github.com/laravel/serializable-closure/issues", "source": "https://github.com/laravel/serializable-closure" }, - "time": "2024-11-19T01:38:44+00:00" + "time": "2024-12-16T15:26:28+00:00" }, { "name": "league/commonmark", @@ -2101,16 +2101,16 @@ }, { "name": "livewire/livewire", - "version": "v3.5.17", + "version": "v3.5.18", "source": { "type": "git", "url": "https://github.com/livewire/livewire.git", - "reference": "7bbf80d93db9b866776bf957ca6229364bca8d87" + "reference": "62f0fa6b340a467c25baa590a567d9a134b357da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/livewire/livewire/zipball/7bbf80d93db9b866776bf957ca6229364bca8d87", - "reference": "7bbf80d93db9b866776bf957ca6229364bca8d87", + "url": "https://api.github.com/repos/livewire/livewire/zipball/62f0fa6b340a467c25baa590a567d9a134b357da", + "reference": "62f0fa6b340a467c25baa590a567d9a134b357da", "shasum": "" }, "require": { @@ -2165,7 +2165,7 @@ "description": "A front-end framework for Laravel.", "support": { "issues": "https://github.com/livewire/livewire/issues", - "source": "https://github.com/livewire/livewire/tree/v3.5.17" + "source": "https://github.com/livewire/livewire/tree/v3.5.18" }, "funding": [ { @@ -2173,7 +2173,7 @@ "type": "github" } ], - "time": "2024-12-06T13:41:21+00:00" + "time": "2024-12-23T15:05:02+00:00" }, { "name": "monolog/monolog", @@ -2280,16 +2280,16 @@ }, { "name": "nesbot/carbon", - "version": "3.8.2", + "version": "3.8.4", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "e1268cdbc486d97ce23fef2c666dc3c6b6de9947" + "reference": "129700ed449b1f02d70272d2ac802357c8c30c58" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/e1268cdbc486d97ce23fef2c666dc3c6b6de9947", - "reference": "e1268cdbc486d97ce23fef2c666dc3c6b6de9947", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/129700ed449b1f02d70272d2ac802357c8c30c58", + "reference": "129700ed449b1f02d70272d2ac802357c8c30c58", "shasum": "" }, "require": { @@ -2321,10 +2321,6 @@ ], "type": "library", "extra": { - "branch-alias": { - "dev-master": "3.x-dev", - "dev-2.x": "2.x-dev" - }, "laravel": { "providers": [ "Carbon\\Laravel\\ServiceProvider" @@ -2334,6 +2330,10 @@ "includes": [ "extension.neon" ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev", + "dev-master": "3.x-dev" } }, "autoload": { @@ -2382,7 +2382,7 @@ "type": "tidelift" } ], - "time": "2024-11-07T17:46:48+00:00" + "time": "2024-12-27T09:25:35+00:00" }, { "name": "nette/schema", @@ -5984,31 +5984,33 @@ }, { "name": "tijsverkoyen/css-to-inline-styles", - "version": "v2.2.7", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/tijsverkoyen/CssToInlineStyles.git", - "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb" + "reference": "0d72ac1c00084279c1816675284073c5a337c20d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/83ee6f38df0a63106a9e4536e3060458b74ccedb", - "reference": "83ee6f38df0a63106a9e4536e3060458b74ccedb", + "url": "https://api.github.com/repos/tijsverkoyen/CssToInlineStyles/zipball/0d72ac1c00084279c1816675284073c5a337c20d", + "reference": "0d72ac1c00084279c1816675284073c5a337c20d", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", - "php": "^5.5 || ^7.0 || ^8.0", - "symfony/css-selector": "^2.7 || ^3.0 || ^4.0 || ^5.0 || ^6.0 || ^7.0" + "php": "^7.4 || ^8.0", + "symfony/css-selector": "^5.4 || ^6.0 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^7.5 || ^8.5.21 || ^9.5.10" + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpunit/phpunit": "^8.5.21 || ^9.5.10" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { @@ -6031,9 +6033,9 @@ "homepage": "https://github.com/tijsverkoyen/CssToInlineStyles", "support": { "issues": "https://github.com/tijsverkoyen/CssToInlineStyles/issues", - "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/v2.2.7" + "source": "https://github.com/tijsverkoyen/CssToInlineStyles/tree/v2.3.0" }, - "time": "2023-12-08T13:03:43+00:00" + "time": "2024-12-21T16:25:41+00:00" }, { "name": "vlucas/phpdotenv", @@ -6255,16 +6257,16 @@ "packages-dev": [ { "name": "barryvdh/laravel-ide-helper", - "version": "v3.2.2", + "version": "v3.3.0", "source": { "type": "git", "url": "https://github.com/barryvdh/laravel-ide-helper.git", - "reference": "07e3bd8796f3d1414801a03d3783f9d3ec9efc08" + "reference": "b7675670f75914bf34afdea52a6c2fe3781f7c44" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/07e3bd8796f3d1414801a03d3783f9d3ec9efc08", - "reference": "07e3bd8796f3d1414801a03d3783f9d3ec9efc08", + "url": "https://api.github.com/repos/barryvdh/laravel-ide-helper/zipball/b7675670f75914bf34afdea52a6c2fe3781f7c44", + "reference": "b7675670f75914bf34afdea52a6c2fe3781f7c44", "shasum": "" }, "require": { @@ -6333,7 +6335,7 @@ ], "support": { "issues": "https://github.com/barryvdh/laravel-ide-helper/issues", - "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v3.2.2" + "source": "https://github.com/barryvdh/laravel-ide-helper/tree/v3.3.0" }, "funding": [ { @@ -6345,7 +6347,7 @@ "type": "github" } ], - "time": "2024-10-29T14:00:16+00:00" + "time": "2024-12-18T08:24:19+00:00" }, { "name": "barryvdh/reflection-docblock", @@ -6499,13 +6501,13 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.x-dev" - }, "phpstan": { "includes": [ "extension.neon" ] + }, + "branch-alias": { + "dev-main": "3.x-dev" } }, "autoload": { @@ -8697,6 +8699,6 @@ "platform": { "php": "^8.2" }, - "platform-dev": {}, - "plugin-api-version": "2.6.0" + "platform-dev": [], + "plugin-api-version": "2.2.0" } diff --git a/resources/views/blog/post.blade.php b/resources/views/blog/post.blade.php index 0401d5824..af881c807 100644 --- a/resources/views/blog/post.blade.php +++ b/resources/views/blog/post.blade.php @@ -10,7 +10,7 @@ diff --git a/src/Controller/Socials/PostThumbnailController.php b/src/Controller/Socials/PostThumbnailController.php index c9843578e..885062caf 100644 --- a/src/Controller/Socials/PostThumbnailController.php +++ b/src/Controller/Socials/PostThumbnailController.php @@ -23,13 +23,13 @@ public function __construct( ) { } - public function __invoke(string $title): BinaryFileResponse + public function __invoke(string $lowercasedTitle): BinaryFileResponse { - $imageFilePath = $this->thumbnailGenerator->resolveImageFilePath($title); + $imageFilePath = $this->thumbnailGenerator->resolveImageFilePath($lowercasedTitle); // on the fly if (! file_exists($imageFilePath)) { - $this->createImage($title, $imageFilePath); + $this->createImage($lowercasedTitle, $imageFilePath); } return response()->file($imageFilePath); @@ -46,7 +46,7 @@ private function createImage(string $title, string $imageFilePath): void $greenFont = $this->thumbnailGenerator->createFont(FontFile::INTER, '59a35e', 40); - $post = $this->postRepository->findByTitle($title); + $post = $this->postRepository->findByLowercasedTitle($title); if (! $post instanceof Post) { return; } diff --git a/src/Entity/Post.php b/src/Entity/Post.php index 3eb0a3c26..ca16d0ca6 100644 --- a/src/Entity/Post.php +++ b/src/Entity/Post.php @@ -42,6 +42,11 @@ public function getClearTitle(): string return str_replace('?', '', $clearTitle); } + public function getClearTitleLowercased(): string + { + return strtolower($this->getClearTitle()); + } + public function getPerex(): string { return $this->perex; diff --git a/src/Repository/PostRepository.php b/src/Repository/PostRepository.php index cfe6bfc67..ae55c4396 100644 --- a/src/Repository/PostRepository.php +++ b/src/Repository/PostRepository.php @@ -36,9 +36,9 @@ public function getPosts(): array return $this->posts; } - public function findByTitle(string $title): ?Post + public function findByLowercasedTitle(string $lowercasedTitle): ?Post { - $filter = static fn (Post $post): bool => $post->getTitle() === $title; + $filter = static fn (Post $post): bool => strtolower($post->getTitle()) === $lowercasedTitle; return ArrayLookupFinder::first($this->posts, $filter); }