5 Commits

Author SHA1 Message Date
0da1aa4ff6 Country stats and searching by exact model name.
All checks were successful
/ deploy-job (push) Successful in 0s
2026-02-24 08:44:23 +01:00
59f10e620f Add country name when filtering by country name
All checks were successful
/ deploy-job (push) Successful in 0s
2026-02-23 08:37:12 +01:00
9f322d874e Add link to now lowest badge
All checks were successful
/ deploy-job (push) Successful in 0s
2026-02-23 08:29:46 +01:00
10cd2c59a3 Add countries selector
All checks were successful
/ deploy-job (push) Successful in 1s
2026-02-22 09:37:19 +01:00
810643c18a Start working on filtering by country
All checks were successful
/ deploy-job (push) Successful in 0s
2026-02-21 08:40:07 +01:00
11 changed files with 205 additions and 195 deletions

View File

@@ -1,7 +1,5 @@
on:
push:
branches:
- master
workflow_dispatch:
jobs:
deploy-job:

200
composer.lock generated
View File

@@ -1616,16 +1616,16 @@
},
{
"name": "symfony/cache",
"version": "v8.0.6",
"version": "v8.0.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/cache.git",
"reference": "59184fa14658d7724cd9b8743d91c1b1aa618bff"
"reference": "92e9960386c7e01f58198038c199d522959a843c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/cache/zipball/59184fa14658d7724cd9b8743d91c1b1aa618bff",
"reference": "59184fa14658d7724cd9b8743d91c1b1aa618bff",
"url": "https://api.github.com/repos/symfony/cache/zipball/92e9960386c7e01f58198038c199d522959a843c",
"reference": "92e9960386c7e01f58198038c199d522959a843c",
"shasum": ""
},
"require": {
@@ -1692,7 +1692,7 @@
"psr6"
],
"support": {
"source": "https://github.com/symfony/cache/tree/v8.0.6"
"source": "https://github.com/symfony/cache/tree/v8.0.5"
},
"funding": [
{
@@ -1712,7 +1712,7 @@
"type": "tidelift"
}
],
"time": "2026-02-21T23:29:37+00:00"
"time": "2026-01-27T16:18:07+00:00"
},
{
"name": "symfony/cache-contracts",
@@ -1869,16 +1869,16 @@
},
{
"name": "symfony/config",
"version": "v8.0.6",
"version": "v8.0.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
"reference": "94ea198de42f93dffa920a098cac3961a82e63b7"
"reference": "8f45af92f08f82902827a8b6f403aaf49d893539"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/config/zipball/94ea198de42f93dffa920a098cac3961a82e63b7",
"reference": "94ea198de42f93dffa920a098cac3961a82e63b7",
"url": "https://api.github.com/repos/symfony/config/zipball/8f45af92f08f82902827a8b6f403aaf49d893539",
"reference": "8f45af92f08f82902827a8b6f403aaf49d893539",
"shasum": ""
},
"require": {
@@ -1923,7 +1923,7 @@
"description": "Helps you find, load, combine, autofill and validate configuration values of any kind",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/config/tree/v8.0.6"
"source": "https://github.com/symfony/config/tree/v8.0.4"
},
"funding": [
{
@@ -1943,20 +1943,20 @@
"type": "tidelift"
}
],
"time": "2026-02-25T16:59:43+00:00"
"time": "2026-01-13T13:06:50+00:00"
},
{
"name": "symfony/console",
"version": "v8.0.6",
"version": "v8.0.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "488285876e807a4777f074041d8bb508623419fa"
"reference": "ace03c4cf9805080ff40cbeec69fca180c339a3b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/488285876e807a4777f074041d8bb508623419fa",
"reference": "488285876e807a4777f074041d8bb508623419fa",
"url": "https://api.github.com/repos/symfony/console/zipball/ace03c4cf9805080ff40cbeec69fca180c339a3b",
"reference": "ace03c4cf9805080ff40cbeec69fca180c339a3b",
"shasum": ""
},
"require": {
@@ -2013,7 +2013,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v8.0.6"
"source": "https://github.com/symfony/console/tree/v8.0.4"
},
"funding": [
{
@@ -2033,20 +2033,20 @@
"type": "tidelift"
}
],
"time": "2026-02-25T16:59:43+00:00"
"time": "2026-01-13T13:06:50+00:00"
},
{
"name": "symfony/dependency-injection",
"version": "v8.0.6",
"version": "v8.0.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
"reference": "edd98864a7b9eaaa10f389bd414e7d9e816bb59d"
"reference": "40a6c455ade7e3bf25900d6b746d40cfa2573e26"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/edd98864a7b9eaaa10f389bd414e7d9e816bb59d",
"reference": "edd98864a7b9eaaa10f389bd414e7d9e816bb59d",
"url": "https://api.github.com/repos/symfony/dependency-injection/zipball/40a6c455ade7e3bf25900d6b746d40cfa2573e26",
"reference": "40a6c455ade7e3bf25900d6b746d40cfa2573e26",
"shasum": ""
},
"require": {
@@ -2094,7 +2094,7 @@
"description": "Allows you to standardize and centralize the way objects are constructed in your application",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/dependency-injection/tree/v8.0.6"
"source": "https://github.com/symfony/dependency-injection/tree/v8.0.5"
},
"funding": [
{
@@ -2114,7 +2114,7 @@
"type": "tidelift"
}
],
"time": "2026-02-25T16:59:43+00:00"
"time": "2026-01-27T16:18:07+00:00"
},
{
"name": "symfony/deprecation-contracts",
@@ -2185,16 +2185,16 @@
},
{
"name": "symfony/dotenv",
"version": "v8.0.6",
"version": "v8.0.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/dotenv.git",
"reference": "94d59769b0ea491dd8b635089e766519d28773d6"
"reference": "460b4067a85288c59a59ce8c1bfb3942e71fd85c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/dotenv/zipball/94d59769b0ea491dd8b635089e766519d28773d6",
"reference": "94d59769b0ea491dd8b635089e766519d28773d6",
"url": "https://api.github.com/repos/symfony/dotenv/zipball/460b4067a85288c59a59ce8c1bfb3942e71fd85c",
"reference": "460b4067a85288c59a59ce8c1bfb3942e71fd85c",
"shasum": ""
},
"require": {
@@ -2235,7 +2235,7 @@
"environment"
],
"support": {
"source": "https://github.com/symfony/dotenv/tree/v8.0.6"
"source": "https://github.com/symfony/dotenv/tree/v8.0.0"
},
"funding": [
{
@@ -2255,7 +2255,7 @@
"type": "tidelift"
}
],
"time": "2026-02-13T12:00:38+00:00"
"time": "2025-11-16T10:17:21+00:00"
},
{
"name": "symfony/error-handler",
@@ -2501,16 +2501,16 @@
},
{
"name": "symfony/filesystem",
"version": "v8.0.6",
"version": "v8.0.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
"reference": "7bf9162d7a0dff98d079b72948508fa48018a770"
"reference": "d937d400b980523dc9ee946bb69972b5e619058d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/7bf9162d7a0dff98d079b72948508fa48018a770",
"reference": "7bf9162d7a0dff98d079b72948508fa48018a770",
"url": "https://api.github.com/repos/symfony/filesystem/zipball/d937d400b980523dc9ee946bb69972b5e619058d",
"reference": "d937d400b980523dc9ee946bb69972b5e619058d",
"shasum": ""
},
"require": {
@@ -2547,7 +2547,7 @@
"description": "Provides basic utilities for the filesystem",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/filesystem/tree/v8.0.6"
"source": "https://github.com/symfony/filesystem/tree/v8.0.1"
},
"funding": [
{
@@ -2567,20 +2567,20 @@
"type": "tidelift"
}
],
"time": "2026-02-25T16:59:43+00:00"
"time": "2025-12-01T09:13:36+00:00"
},
{
"name": "symfony/finder",
"version": "v8.0.6",
"version": "v8.0.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "441404f09a54de6d1bd6ad219e088cdf4c91f97c"
"reference": "8bd576e97c67d45941365bf824e18dc8538e6eb0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/441404f09a54de6d1bd6ad219e088cdf4c91f97c",
"reference": "441404f09a54de6d1bd6ad219e088cdf4c91f97c",
"url": "https://api.github.com/repos/symfony/finder/zipball/8bd576e97c67d45941365bf824e18dc8538e6eb0",
"reference": "8bd576e97c67d45941365bf824e18dc8538e6eb0",
"shasum": ""
},
"require": {
@@ -2615,7 +2615,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/finder/tree/v8.0.6"
"source": "https://github.com/symfony/finder/tree/v8.0.5"
},
"funding": [
{
@@ -2635,20 +2635,20 @@
"type": "tidelift"
}
],
"time": "2026-01-29T09:41:02+00:00"
"time": "2026-01-26T15:08:38+00:00"
},
{
"name": "symfony/framework-bundle",
"version": "v8.0.6",
"version": "v8.0.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/framework-bundle.git",
"reference": "86ebd86908edca06e3af5994bc46881575fbe813"
"reference": "e2f9469e7a802dd7c0d193792afc494d68177c54"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/framework-bundle/zipball/86ebd86908edca06e3af5994bc46881575fbe813",
"reference": "86ebd86908edca06e3af5994bc46881575fbe813",
"url": "https://api.github.com/repos/symfony/framework-bundle/zipball/e2f9469e7a802dd7c0d193792afc494d68177c54",
"reference": "e2f9469e7a802dd7c0d193792afc494d68177c54",
"shasum": ""
},
"require": {
@@ -2671,7 +2671,7 @@
},
"conflict": {
"doctrine/persistence": "<1.3",
"phpdocumentor/reflection-docblock": "<5.2|>=7",
"phpdocumentor/reflection-docblock": "<5.2|>=6",
"phpdocumentor/type-resolver": "<1.5.1",
"symfony/console": "<7.4",
"symfony/form": "<7.4",
@@ -2686,7 +2686,7 @@
"require-dev": {
"doctrine/persistence": "^1.3|^2|^3",
"dragonmantank/cron-expression": "^3.1",
"phpdocumentor/reflection-docblock": "^5.2|^6.0",
"phpdocumentor/reflection-docblock": "^5.2",
"phpstan/phpdoc-parser": "^1.0|^2.0",
"seld/jsonlint": "^1.10",
"symfony/asset": "^7.4|^8.0",
@@ -2755,7 +2755,7 @@
"description": "Provides a tight integration between Symfony components and the Symfony full-stack framework",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/framework-bundle/tree/v8.0.6"
"source": "https://github.com/symfony/framework-bundle/tree/v8.0.5"
},
"funding": [
{
@@ -2775,20 +2775,20 @@
"type": "tidelift"
}
],
"time": "2026-02-25T16:59:43+00:00"
"time": "2026-01-27T09:06:10+00:00"
},
{
"name": "symfony/http-foundation",
"version": "v8.0.6",
"version": "v8.0.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "7745ff1aad45d855fe25b08969269ef83b1ad8bc"
"reference": "e3422806e6f6760dbed0ddbc0a7fbfb6b5ce96bb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/7745ff1aad45d855fe25b08969269ef83b1ad8bc",
"reference": "7745ff1aad45d855fe25b08969269ef83b1ad8bc",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/e3422806e6f6760dbed0ddbc0a7fbfb6b5ce96bb",
"reference": "e3422806e6f6760dbed0ddbc0a7fbfb6b5ce96bb",
"shasum": ""
},
"require": {
@@ -2835,7 +2835,7 @@
"description": "Defines an object-oriented layer for the HTTP specification",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-foundation/tree/v8.0.6"
"source": "https://github.com/symfony/http-foundation/tree/v8.0.5"
},
"funding": [
{
@@ -2855,20 +2855,20 @@
"type": "tidelift"
}
],
"time": "2026-02-21T16:28:39+00:00"
"time": "2026-01-27T16:18:07+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v8.0.6",
"version": "v8.0.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "b567e571e74b5774b3d3cb4d35bdafa5f37e51a9"
"reference": "20c1c5e41fc53928dbb670088f544f2d460d497d"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/b567e571e74b5774b3d3cb4d35bdafa5f37e51a9",
"reference": "b567e571e74b5774b3d3cb4d35bdafa5f37e51a9",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/20c1c5e41fc53928dbb670088f544f2d460d497d",
"reference": "20c1c5e41fc53928dbb670088f544f2d460d497d",
"shasum": ""
},
"require": {
@@ -2939,7 +2939,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-kernel/tree/v8.0.6"
"source": "https://github.com/symfony/http-kernel/tree/v8.0.5"
},
"funding": [
{
@@ -2959,20 +2959,20 @@
"type": "tidelift"
}
],
"time": "2026-02-26T08:36:42+00:00"
"time": "2026-01-28T10:46:31+00:00"
},
{
"name": "symfony/intl",
"version": "v8.0.6",
"version": "v8.0.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/intl.git",
"reference": "4e14323828f51a293edbce15ca98d4f3dd927cbf"
"reference": "8d049269c2accca0b02e5f9de39f3ee92ebc4468"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/intl/zipball/4e14323828f51a293edbce15ca98d4f3dd927cbf",
"reference": "4e14323828f51a293edbce15ca98d4f3dd927cbf",
"url": "https://api.github.com/repos/symfony/intl/zipball/8d049269c2accca0b02e5f9de39f3ee92ebc4468",
"reference": "8d049269c2accca0b02e5f9de39f3ee92ebc4468",
"shasum": ""
},
"require": {
@@ -3028,7 +3028,7 @@
"localization"
],
"support": {
"source": "https://github.com/symfony/intl/tree/v8.0.6"
"source": "https://github.com/symfony/intl/tree/v8.0.4"
},
"funding": [
{
@@ -3048,7 +3048,7 @@
"type": "tidelift"
}
],
"time": "2026-02-09T10:14:57+00:00"
"time": "2026-01-12T12:37:40+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -3467,16 +3467,16 @@
},
{
"name": "symfony/routing",
"version": "v8.0.6",
"version": "v8.0.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
"reference": "053c40fd46e1d19c5c5a94cada93ce6c3facdd55"
"reference": "4a2bc08d1c35307239329f434d45c2bfe8241fa9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/053c40fd46e1d19c5c5a94cada93ce6c3facdd55",
"reference": "053c40fd46e1d19c5c5a94cada93ce6c3facdd55",
"url": "https://api.github.com/repos/symfony/routing/zipball/4a2bc08d1c35307239329f434d45c2bfe8241fa9",
"reference": "4a2bc08d1c35307239329f434d45c2bfe8241fa9",
"shasum": ""
},
"require": {
@@ -3523,7 +3523,7 @@
"url"
],
"support": {
"source": "https://github.com/symfony/routing/tree/v8.0.6"
"source": "https://github.com/symfony/routing/tree/v8.0.4"
},
"funding": [
{
@@ -3543,7 +3543,7 @@
"type": "tidelift"
}
],
"time": "2026-02-25T16:59:43+00:00"
"time": "2026-01-12T12:37:40+00:00"
},
{
"name": "symfony/service-contracts",
@@ -3634,16 +3634,16 @@
},
{
"name": "symfony/string",
"version": "v8.0.6",
"version": "v8.0.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "6c9e1108041b5dce21a9a4984b531c4923aa9ec4"
"reference": "758b372d6882506821ed666032e43020c4f57194"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/6c9e1108041b5dce21a9a4984b531c4923aa9ec4",
"reference": "6c9e1108041b5dce21a9a4984b531c4923aa9ec4",
"url": "https://api.github.com/repos/symfony/string/zipball/758b372d6882506821ed666032e43020c4f57194",
"reference": "758b372d6882506821ed666032e43020c4f57194",
"shasum": ""
},
"require": {
@@ -3700,7 +3700,7 @@
"utf8"
],
"support": {
"source": "https://github.com/symfony/string/tree/v8.0.6"
"source": "https://github.com/symfony/string/tree/v8.0.4"
},
"funding": [
{
@@ -3720,20 +3720,20 @@
"type": "tidelift"
}
],
"time": "2026-02-09T10:14:57+00:00"
"time": "2026-01-12T12:37:40+00:00"
},
{
"name": "symfony/translation",
"version": "v8.0.6",
"version": "v8.0.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "13ff19bcf2bea492d3c2fbeaa194dd6f4599ce1b"
"reference": "db70c8ce7db74fd2da7b1d268db46b2a8ce32c10"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/13ff19bcf2bea492d3c2fbeaa194dd6f4599ce1b",
"reference": "13ff19bcf2bea492d3c2fbeaa194dd6f4599ce1b",
"url": "https://api.github.com/repos/symfony/translation/zipball/db70c8ce7db74fd2da7b1d268db46b2a8ce32c10",
"reference": "db70c8ce7db74fd2da7b1d268db46b2a8ce32c10",
"shasum": ""
},
"require": {
@@ -3793,7 +3793,7 @@
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/translation/tree/v8.0.6"
"source": "https://github.com/symfony/translation/tree/v8.0.4"
},
"funding": [
{
@@ -3813,7 +3813,7 @@
"type": "tidelift"
}
],
"time": "2026-02-17T13:07:04+00:00"
"time": "2026-01-13T13:06:50+00:00"
},
{
"name": "symfony/translation-contracts",
@@ -3899,16 +3899,16 @@
},
{
"name": "symfony/twig-bridge",
"version": "v8.0.6",
"version": "v8.0.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/twig-bridge.git",
"reference": "a29b174218f6eb324bf24f60440ac81d17f6ee0d"
"reference": "3e60c35cb47b1077524c066ec277eaf92cdc2393"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/twig-bridge/zipball/a29b174218f6eb324bf24f60440ac81d17f6ee0d",
"reference": "a29b174218f6eb324bf24f60440ac81d17f6ee0d",
"url": "https://api.github.com/repos/symfony/twig-bridge/zipball/3e60c35cb47b1077524c066ec277eaf92cdc2393",
"reference": "3e60c35cb47b1077524c066ec277eaf92cdc2393",
"shasum": ""
},
"require": {
@@ -3917,14 +3917,14 @@
"twig/twig": "^3.21"
},
"conflict": {
"phpdocumentor/reflection-docblock": "<5.2|>=7",
"phpdocumentor/reflection-docblock": "<5.2|>=6",
"phpdocumentor/type-resolver": "<1.5.1",
"symfony/form": "<7.4.4|>8.0,<8.0.4"
},
"require-dev": {
"egulias/email-validator": "^2.1.10|^3|^4",
"league/html-to-markdown": "^5.0",
"phpdocumentor/reflection-docblock": "^5.2|^6.0",
"phpdocumentor/reflection-docblock": "^5.2",
"symfony/asset": "^7.4|^8.0",
"symfony/asset-mapper": "^7.4|^8.0",
"symfony/console": "^7.4|^8.0",
@@ -3982,7 +3982,7 @@
"description": "Provides integration for Twig with various Symfony components",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/twig-bridge/tree/v8.0.6"
"source": "https://github.com/symfony/twig-bridge/tree/v8.0.5"
},
"funding": [
{
@@ -4002,7 +4002,7 @@
"type": "tidelift"
}
],
"time": "2026-02-25T16:59:43+00:00"
"time": "2026-01-27T09:06:10+00:00"
},
{
"name": "symfony/twig-bundle",
@@ -4090,16 +4090,16 @@
},
{
"name": "symfony/var-dumper",
"version": "v8.0.6",
"version": "v8.0.4",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "2e14f7e0bf5ff02c6e63bd31cb8e4855a13d6209"
"reference": "326e0406fc315eca57ef5740fa4a280b7a068c82"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/2e14f7e0bf5ff02c6e63bd31cb8e4855a13d6209",
"reference": "2e14f7e0bf5ff02c6e63bd31cb8e4855a13d6209",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/326e0406fc315eca57ef5740fa4a280b7a068c82",
"reference": "326e0406fc315eca57ef5740fa4a280b7a068c82",
"shasum": ""
},
"require": {
@@ -4153,7 +4153,7 @@
"dump"
],
"support": {
"source": "https://github.com/symfony/var-dumper/tree/v8.0.6"
"source": "https://github.com/symfony/var-dumper/tree/v8.0.4"
},
"funding": [
{
@@ -4173,7 +4173,7 @@
"type": "tidelift"
}
],
"time": "2026-02-15T10:53:29+00:00"
"time": "2026-01-01T23:07:29+00:00"
},
{
"name": "symfony/var-exporter",

View File

@@ -76,8 +76,6 @@ class ScrapeWebsite extends Command
$output->writeln('Update prices - DONE');
$output->writeln('COMMAND - DONE');
file_put_contents('templates/lastscrape.html.twig', date('Y-m-d H:i:s'));
return Command::SUCCESS;
}

View File

@@ -0,0 +1,40 @@
<?php
namespace Krzysiej\RyobiCrawler\Controller;
use Illuminate\Database\Eloquent\Builder;
use Krzysiej\RyobiCrawler\Models\Country;
use Krzysiej\RyobiCrawler\Models\Product;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
final class CountryController extends BaseController
{
#[Route('/country/{countryName?}', name: 'app_country')]
public function __invoke(?string $countryName): Response
{
/** @var Product[] $products */
$products = Product::with(['price', 'lowestPrice', 'country'])
->join('countries', 'countries.id', '=', 'products.country_id')
->where('countryName', $countryName)
->orderByDesc('starred')
->orderByDesc('created_by')
->get();
$country = Country::where('countryName', $countryName)->first();
return $this->render('productList.html.twig', ['products' => $products, 'listType' => 'country', 'country' => $country, 'countryStats' => $this->countryStats($countryName)]);
}
private function countryStats(string $country): array
{
$countryProducts = Product::join('countries', 'countries.id', '=', 'products.country_id')
->where('countryName', $country);
$stats = [];
$stats['items'] = $countryProducts->get()->count();
// $stats['items2'] = $countryProducts->dd();
return $stats;
}
}

View File

@@ -32,6 +32,32 @@ final class ProductController extends BaseController
ksort($stockList);
ksort($priceList);
return $this->render('product.html.twig', [
'product' => $product,
'price_list' => $this->prepareChartData($priceList),
'stock_list' => $this->prepareChartData($stockList),
'price_dates' => implode("','", $this->dateRange(array_key_first($priceList), array_key_last($priceList))),
]);
}
#[Route('/product/model/{productModel}', name: 'app_product_model')]
public function productModel(string $productModel): Response
{
$product = Product::with([
'price' => fn($query) => $query->orderBy('created_at', 'desc'),
'stock' => fn($query) => $query->orderBy('created_at', 'desc'),
])->where('subTitle', $productModel)->first();
if (null === $product) {
throw $this->createNotFoundException('Product not found');
}
$priceList = $product->price()->pluck('price', 'created_at')->mapWithKeys(fn($price, $createdAt) => [explode(' ', $createdAt)[0] => $price])->toArray();
$stockList = $product->stock()->pluck('stock', 'created_at')->mapWithKeys(fn($stock, $createdAt) => [explode(' ', $createdAt)[0] => $stock])->toArray();
ksort($stockList);
ksort($priceList);
return $this->render('product.html.twig', [
'product' => $product,
'price_list' => $this->prepareChartData($priceList),

View File

@@ -7,9 +7,13 @@ use Krzysiej\RyobiCrawler\Twig\AppExtension;
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait;
use Symfony\Bundle\TwigBundle\TwigBundle;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpKernel\Kernel as BaseKernel;
use Symfony\Component\Routing\Loader\Configurator\RoutingConfigurator;
use Twig\Extra\Cache\CacheExtension;
use Twig\Extra\Cache\CacheRuntime;
use Twig\Extra\TwigExtraBundle\TwigExtraBundle;
class Kernel extends BaseKernel

View File

@@ -3,6 +3,7 @@
namespace Krzysiej\RyobiCrawler\Twig;
use Illuminate\Database\Eloquent\Collection;
use Krzysiej\RyobiCrawler\Models\Country;
use Krzysiej\RyobiCrawler\Models\Price;
use Krzysiej\RyobiCrawler\Models\Product;
use Krzysiej\RyobiCrawler\Models\Stock;
@@ -28,6 +29,7 @@ class AppExtension extends AbstractExtension
new TwigFunction('discontinuedCount', [$this, 'discontinuedCount']),
new TwigFunction('lowestPriceCount', [$this, 'lowestPriceCount']),
new TwigFunction('renderCategoryTree', [$this, 'renderCategoryTree']),
new TwigFunction('getCountries', [$this, 'getCountries']),
];
}
@@ -66,6 +68,11 @@ class AppExtension extends AbstractExtension
->count();
}
public function getCountries(): array
{
return Country::get()->toArray();
}
public function findByCreatedAtDate(Collection $items, string $date): Stock|Price|null
{
return $items->first(fn($item) => str_starts_with($item->created_at, $date));

View File

@@ -1,12 +0,0 @@
<div class="container">
<footer class="d-flex flex-wrap justify-content-between align-items-center py-3 my-4 border-top">
<div class="col-md-4 d-flex align-items-center">
<span class="mb-md-0 text-body-secondary">© 2025 Company, Inc</span>
<a class="align-items-center text-decoration-none" data-bs-theme-value="light">☀️ Light</a>
<a class="align-items-center text-decoration-none" data-bs-theme-value="dark">🌕 Dark</a>
</div>
<div class="col-md-4 text-end text-muted">
{{ include('lastscrape.html.twig', ignore_missing: true) }}
</div>
</footer>
</div>

View File

@@ -11,7 +11,8 @@
<td>
<a href='{{ path('app_product', {'productId': product.id}) }}'
class="text-decoration-none">{{ product.name }}</a>
<a href="{{ path('app_search', {'search': product.subTitle}) }}"><span class="badge text-bg-secondary">{{ product.subTitle }}</span></a>
<span class="badge text-bg-light"><a href="{{ path('app_product_model', {'productModel': product.subTitle}) }}"
class="link-underline link-underline-opacity-0 link-dark">{{ product.subTitle }}</a></span>
{% if product.promotions is not null and product.promotions.hasPromotion %}<a
href="{{ path('app_promos', {'promo': product.promotions.slug}) }}"><span class="badge bg-info">PROMO: {{ product.promotions.tag }}</span>
</a>{% endif %}

View File

@@ -19,6 +19,12 @@
</ul>
{% endif %}
{% if listType == 'country' and country is not null%}
<h2 class="text-muted mt-4 mx-4">{{ country.countryName }}</h2>
<h5 class="mx-4 my-0">Currency: {{ country.currency }}</h5>
{{ dump(countryStats) }}
{% endif %}
{% if (listType starts with 'category_' and category == null) or not (listType starts with 'category_') or (listType starts with 'category_' and category is not null) %}
<div class="table-responsive">
@@ -48,19 +54,22 @@
class="text-decoration-none">{{ product.name }}</a>
<br>
{% if product.stock > 0 %}
<span class="badge text-bg-secondary">stock: {{ product.stock }}</span>
<span class="badge text-bg-light">stock: {{ product.stock }}</span>
{% else %}
<span class="badge text-bg-warning">out of stock</span>
{% endif %}
{% if product.isDiscontinued() %}
<a href="{{ path('app_discontinued') }}"><span class="badge text-bg-secondary" data-bs-title="Last update: {{ product.lastSeen }}">is discontinued</span></a>
<a href="{{ path('app_discontinued') }}"><span class="badge text-bg-secondary" data-bs-toggle="tooltip"
data-bs-title="Last update: {{ product.lastSeen }}">is discontinued</span></a>
{% endif %}
{% if product.isNew() %}
<a href="{{ path('app_new') }}"><span class="badge text-bg-success">is new</span></a>
{% endif %}
<a href="{{ path('app_search', {'search': product.subTitle}) }}"><span class="badge text-bg-secondary">{{ product.subTitle }}</span></a>
<span class="badge text-bg-light"><a
href="{{ path('app_product_model', {'productModel': product.subTitle}) }}"
class="link-underline link-underline-opacity-0 link-dark">{{ product.subTitle }}</a></span>
{% if product.promotions is not null and product.promotions.hasPromotion %}<a href="{{ path('app_promos', {'promo': product.promotions.slug}) }}"><span class="badge bg-info">PROMO: {{ product.promotions.tag }}</span></a>{% endif %}
<span class="badge text-bg-secondary">{{ product.country.countryName }}</span>
<span class="badge text-bg-light"><a href="{{ path('app_country', {'countryName': product.country.countryName}) }}" class="link-underline link-underline-opacity-0 link-dark">{{ product.country.countryName }}</a></span>
</td>
<td class="align-middle">
<nav aria-label="breadcrumb" style="--bs-breadcrumb-divider: '>';">
@@ -80,7 +89,7 @@
{{ product.priceLowest | format_currency(product.country.currency, {}, product.country.locale) }}
{% else %}
{% if product.priceLowest != product.priceCurrent %}{{ product.priceLowest | format_currency(product.country.currency, {}, product.country.locale) }}{% else %}
<span class="badge text-bg-info">now lowest</span>{% endif %}</td>
<a href="{{ path('app_lowest_price') }}"><span class="badge bg-info">now lowest</span></a>{% endif %}</td>
{% endif %}
<td class="align-middle text-end">{{ product.priceCurrent | format_currency(product.country.currency, {}, product.country.locale) }}</td>

View File

@@ -1,75 +1,6 @@
<!doctype html>
<html lang="en" data-bs-theme="">
<html lang="en" data-bs-theme="light">
<head>
<script>
(() => {
'use strict'
const getStoredTheme = () => localStorage.getItem('theme')
const setStoredTheme = theme => localStorage.setItem('theme', theme)
const getPreferredTheme = () => {
const storedTheme = getStoredTheme()
if (storedTheme) {
return storedTheme
}
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'
}
const setTheme = theme => {
if (theme === 'auto') {
document.documentElement.setAttribute('data-bs-theme', (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'))
} else {
document.documentElement.setAttribute('data-bs-theme', theme)
}
}
setTheme(getPreferredTheme())
const showActiveTheme = (theme, focus = false) => {
const themeSwitcher = document.querySelector('#bd-theme')
if (!themeSwitcher) {
return
}
const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`)
document.querySelectorAll('[data-bs-theme-value]').forEach(element => {
element.classList.remove('active')
})
btnToActive.classList.add('active')
if (focus) {
themeSwitcher.focus()
}
}
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => {
const storedTheme = getStoredTheme()
if (storedTheme !== 'light' && storedTheme !== 'dark') {
setTheme(getPreferredTheme())
}
})
window.addEventListener('DOMContentLoaded', () => {
showActiveTheme(getPreferredTheme())
document.querySelectorAll('[data-bs-theme-value]')
.forEach(toggle => {
toggle.addEventListener('click', () => {
const theme = toggle.getAttribute('data-bs-theme-value')
setStoredTheme(theme)
setTheme(theme)
showActiveTheme(theme, true)
})
})
})
})()
</script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
@@ -82,8 +13,7 @@
<div class="container-fluid">
<a class="navbar-brand" href="{{ path('app_home') }}">Crawler</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
@@ -103,6 +33,16 @@
<li class="nav-item">
<a class="nav-link {% if app.request.pathinfo == path('app_discontinued') %}active shadow-sm bg-body rounded{% endif %}" aria-current="page" href="{{ path('app_discontinued') }}">Discontinued <span class="badge text-bg-secondary">{{ discontinuedCount() }}</span></a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
Countries
</a>
<ul class="dropdown-menu">
{% for country in getCountries() %}
<li><a class="dropdown-item" href="{{ path('app_country', {'countryName': country.countryName}) }}">{{ country.countryName }}</a></li>
{% endfor %}
</ul>
</li>
</ul>
<form class="form-floating d-flex col-lg-6 col-sm-8" role="search" action="{{ path('app_search') }}">
@@ -115,7 +55,6 @@
</nav>
{% block content %}{% endblock %}
{{ include('footer.html.twig') }}
<script src="/templates/js/bootstrap.bundle.min.js"></script>
</body>
</html>