From 7a8b9cf4c09d0811ad467a72bcfd267dd4af3824 Mon Sep 17 00:00:00 2001 From: elvira Date: Wed, 9 Sep 2026 14:09:59 +0300 Subject: [PATCH] marketing consent --- .../Checkout/CheckoutController.php | 9 +- composer.lock | 188 +++++++++--------- resources/views/checkout/page.blade.php | 4 +- 3 files changed, 109 insertions(+), 92 deletions(-) diff --git a/app/Http/Controllers/Checkout/CheckoutController.php b/app/Http/Controllers/Checkout/CheckoutController.php index d47c4a1..7b1cac6 100644 --- a/app/Http/Controllers/Checkout/CheckoutController.php +++ b/app/Http/Controllers/Checkout/CheckoutController.php @@ -164,7 +164,14 @@ public function saveAddress(string $locale, Request $request): JsonResponse $this->checkout->setBillingAddress($billing); $cart = $this->checkout->setShippingAddress($shipping); - $cart->meta = [...($cart->meta?->toArray() ?? []), 'ship_to_billing' => $sameAsBilling]; + $cart->meta = [ + ...($cart->meta?->toArray() ?? []), + 'ship_to_billing' => $sameAsBilling, + // Interim storage only — the proper consent record (timestamp, + // policy version) is the back-end Task 2. This just lets the + // checkbox round-trip on reload like every other field. + 'marketing_consent' => $request->boolean('marketing_consent'), + ]; $cart->save(); // ShippingManifest is a request-lifetime singleton whose getOptions() diff --git a/composer.lock b/composer.lock index 94d8852..1e8dee0 100644 --- a/composer.lock +++ b/composer.lock @@ -515,11 +515,11 @@ }, { "name": "boboko/core", - "version": "0.14.0", + "version": "0.16.0", "source": { "type": "git", "url": "https://code.radical-elements.com/boboko/core.git", - "reference": "4ff9bdacc3394bb02537998a2d43adbc2799768a" + "reference": "359e1e262e6ab38fed99f25a0271c2d3b15ab999" }, "require": { "laravel/framework": "^12.0", @@ -551,6 +551,7 @@ "Modules\\Core\\Providers\\CoreServiceProvider", "Modules\\Core\\Providers\\AuthServiceProvider", "Modules\\Core\\Providers\\CustomerServiceProvider", + "Modules\\Core\\Providers\\CheckoutServiceProvider", "Modules\\Core\\Providers\\PaymentServiceProvider", "Modules\\Core\\Providers\\LocalizationServiceProvider", "Modules\\Core\\Providers\\CatalogServiceProvider", @@ -567,7 +568,7 @@ } }, "description": "Core module — authentication and shared panel behaviour", - "time": "2026-09-04T10:06:26+00:00" + "time": "2026-09-08T22:19:31+00:00" }, { "name": "brick/math", @@ -631,16 +632,16 @@ }, { "name": "carbonphp/carbon-doctrine-types", - "version": "3.2.0", + "version": "3.2.1", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon-doctrine-types.git", - "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d" + "reference": "5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/18ba5ddfec8976260ead6e866180bd5d2f71aa1d", - "reference": "18ba5ddfec8976260ead6e866180bd5d2f71aa1d", + "url": "https://api.github.com/repos/CarbonPHP/carbon-doctrine-types/zipball/5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc", + "reference": "5fa5eacafd9ef47c8c6ab9143fc901ba0194d3dc", "shasum": "" }, "require": { @@ -655,6 +656,11 @@ "phpunit/phpunit": "^10.3" }, "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, "autoload": { "psr-4": { "Carbon\\Doctrine\\": "src/Carbon/Doctrine/" @@ -680,7 +686,7 @@ ], "support": { "issues": "https://github.com/CarbonPHP/carbon-doctrine-types/issues", - "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.0" + "source": "https://github.com/CarbonPHP/carbon-doctrine-types/tree/3.2.1" }, "funding": [ { @@ -696,7 +702,7 @@ "type": "tidelift" } ], - "time": "2024-02-09T16:56:22+00:00" + "time": "2026-09-06T14:11:38+00:00" }, { "name": "chillerlan/php-qrcode", @@ -1686,16 +1692,16 @@ }, { "name": "filament/actions", - "version": "v4.12.8", + "version": "v4.13.1", "source": { "type": "git", "url": "https://github.com/filamentphp/actions.git", - "reference": "7bf5935b85e33b7627496e49a36bd196bf5dc228" + "reference": "ca6b6e7fb2f8b3aee5540155474af3ac7f3e47ce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/actions/zipball/7bf5935b85e33b7627496e49a36bd196bf5dc228", - "reference": "7bf5935b85e33b7627496e49a36bd196bf5dc228", + "url": "https://api.github.com/repos/filamentphp/actions/zipball/ca6b6e7fb2f8b3aee5540155474af3ac7f3e47ce", + "reference": "ca6b6e7fb2f8b3aee5540155474af3ac7f3e47ce", "shasum": "" }, "require": { @@ -1731,24 +1737,25 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2026-08-31T17:01:19+00:00" + "time": "2026-09-07T18:36:28+00:00" }, { "name": "filament/filament", - "version": "v4.12.8", + "version": "v4.13.1", "source": { "type": "git", "url": "https://github.com/filamentphp/panels.git", - "reference": "5a51dfc51c31ef6e3bd063ba63923254356fb7f6" + "reference": "8c1adf1b10d43cc17cd34deb4d6f7c42f0bb776a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/panels/zipball/5a51dfc51c31ef6e3bd063ba63923254356fb7f6", - "reference": "5a51dfc51c31ef6e3bd063ba63923254356fb7f6", + "url": "https://api.github.com/repos/filamentphp/panels/zipball/8c1adf1b10d43cc17cd34deb4d6f7c42f0bb776a", + "reference": "8c1adf1b10d43cc17cd34deb4d6f7c42f0bb776a", "shasum": "" }, "require": { "chillerlan/php-qrcode": "^5.0", + "composer-runtime-api": "^2.1", "filament/actions": "self.version", "filament/forms": "self.version", "filament/infolists": "self.version", @@ -1788,20 +1795,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2026-08-31T17:01:25+00:00" + "time": "2026-09-08T10:21:27+00:00" }, { "name": "filament/forms", - "version": "v4.12.8", + "version": "v4.13.1", "source": { "type": "git", "url": "https://github.com/filamentphp/forms.git", - "reference": "282eba77756ed7f28251981a8f27d3018b15006d" + "reference": "4da33a7be66aa238158816e439fa591aac0ac239" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/forms/zipball/282eba77756ed7f28251981a8f27d3018b15006d", - "reference": "282eba77756ed7f28251981a8f27d3018b15006d", + "url": "https://api.github.com/repos/filamentphp/forms/zipball/4da33a7be66aa238158816e439fa591aac0ac239", + "reference": "4da33a7be66aa238158816e439fa591aac0ac239", "shasum": "" }, "require": { @@ -1838,20 +1845,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2026-08-31T17:01:17+00:00" + "time": "2026-09-08T10:18:49+00:00" }, { "name": "filament/infolists", - "version": "v4.12.8", + "version": "v4.13.1", "source": { "type": "git", "url": "https://github.com/filamentphp/infolists.git", - "reference": "097ef96993e0ef5bb82f7660813e699c89b6cec8" + "reference": "638b0b37ce492594567e5819f99e2b0f43b3a69b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/infolists/zipball/097ef96993e0ef5bb82f7660813e699c89b6cec8", - "reference": "097ef96993e0ef5bb82f7660813e699c89b6cec8", + "url": "https://api.github.com/repos/filamentphp/infolists/zipball/638b0b37ce492594567e5819f99e2b0f43b3a69b", + "reference": "638b0b37ce492594567e5819f99e2b0f43b3a69b", "shasum": "" }, "require": { @@ -1883,20 +1890,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2026-08-31T17:01:18+00:00" + "time": "2026-09-07T18:36:32+00:00" }, { "name": "filament/notifications", - "version": "v4.12.8", + "version": "v4.13.1", "source": { "type": "git", "url": "https://github.com/filamentphp/notifications.git", - "reference": "dd2e23e6a3e5a68854e424812adc5c75fbfa17f7" + "reference": "6279e7d1353b370cd4fa2dadaa245227c47add21" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/notifications/zipball/dd2e23e6a3e5a68854e424812adc5c75fbfa17f7", - "reference": "dd2e23e6a3e5a68854e424812adc5c75fbfa17f7", + "url": "https://api.github.com/repos/filamentphp/notifications/zipball/6279e7d1353b370cd4fa2dadaa245227c47add21", + "reference": "6279e7d1353b370cd4fa2dadaa245227c47add21", "shasum": "" }, "require": { @@ -1930,20 +1937,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2026-08-31T17:01:18+00:00" + "time": "2026-09-07T18:35:57+00:00" }, { "name": "filament/query-builder", - "version": "v4.12.8", + "version": "v4.13.1", "source": { "type": "git", "url": "https://github.com/filamentphp/query-builder.git", - "reference": "899a11d90a95cb2b2671f204e234e246a347ad72" + "reference": "d5c5c94cbede3a3d56855e5de173c0a35da2328e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/query-builder/zipball/899a11d90a95cb2b2671f204e234e246a347ad72", - "reference": "899a11d90a95cb2b2671f204e234e246a347ad72", + "url": "https://api.github.com/repos/filamentphp/query-builder/zipball/d5c5c94cbede3a3d56855e5de173c0a35da2328e", + "reference": "d5c5c94cbede3a3d56855e5de173c0a35da2328e", "shasum": "" }, "require": { @@ -1976,20 +1983,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2026-08-31T17:01:19+00:00" + "time": "2026-09-07T18:36:00+00:00" }, { "name": "filament/schemas", - "version": "v4.12.8", + "version": "v4.13.1", "source": { "type": "git", "url": "https://github.com/filamentphp/schemas.git", - "reference": "890cb1dac78fce8c63825195a8d9ca6c6bcc8029" + "reference": "fec2747e8cf1e6ca76d6c883c7f1019da994f771" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/schemas/zipball/890cb1dac78fce8c63825195a8d9ca6c6bcc8029", - "reference": "890cb1dac78fce8c63825195a8d9ca6c6bcc8029", + "url": "https://api.github.com/repos/filamentphp/schemas/zipball/fec2747e8cf1e6ca76d6c883c7f1019da994f771", + "reference": "fec2747e8cf1e6ca76d6c883c7f1019da994f771", "shasum": "" }, "require": { @@ -2021,11 +2028,11 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2026-08-31T17:01:16+00:00" + "time": "2026-09-08T10:20:09+00:00" }, { "name": "filament/spatie-laravel-media-library-plugin", - "version": "v4.12.8", + "version": "v4.13.1", "source": { "type": "git", "url": "https://github.com/filamentphp/spatie-laravel-media-library-plugin.git", @@ -2062,26 +2069,27 @@ }, { "name": "filament/support", - "version": "v4.12.8", + "version": "v4.13.1", "source": { "type": "git", "url": "https://github.com/filamentphp/support.git", - "reference": "37f6b22412f098c8770db1d0edeeb36cf6e47433" + "reference": "73fc0fda6692ac878b9cc0255dd3288577a50cb6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/support/zipball/37f6b22412f098c8770db1d0edeeb36cf6e47433", - "reference": "37f6b22412f098c8770db1d0edeeb36cf6e47433", + "url": "https://api.github.com/repos/filamentphp/support/zipball/73fc0fda6692ac878b9cc0255dd3288577a50cb6", + "reference": "73fc0fda6692ac878b9cc0255dd3288577a50cb6", "shasum": "" }, "require": { "blade-ui-kit/blade-heroicons": "^2.5", + "composer-runtime-api": "^2.1", "danharrin/livewire-rate-limiting": "^2.0", "ext-intl": "*", "illuminate/contracts": "^11.28|^12.0|^13.0", "kirschbaum-development/eloquent-power-joins": "^4.0", "league/uri-components": "^7.0", - "livewire/livewire": "^3.5", + "livewire/livewire": "^3.7", "nette/php-generator": "^4.0", "php": "^8.2", "ryangjchandler/blade-capture-directive": "^1.0", @@ -2116,20 +2124,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2026-09-01T08:55:04+00:00" + "time": "2026-09-07T18:36:12+00:00" }, { "name": "filament/tables", - "version": "v4.12.8", + "version": "v4.13.1", "source": { "type": "git", "url": "https://github.com/filamentphp/tables.git", - "reference": "812745d91c3836cbb8046d9a619386ab7ac07ce7" + "reference": "57662d3b2098e7d156ef507842d4ae98a892212b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/tables/zipball/812745d91c3836cbb8046d9a619386ab7ac07ce7", - "reference": "812745d91c3836cbb8046d9a619386ab7ac07ce7", + "url": "https://api.github.com/repos/filamentphp/tables/zipball/57662d3b2098e7d156ef507842d4ae98a892212b", + "reference": "57662d3b2098e7d156ef507842d4ae98a892212b", "shasum": "" }, "require": { @@ -2162,20 +2170,20 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2026-08-31T17:01:34+00:00" + "time": "2026-09-07T18:36:28+00:00" }, { "name": "filament/widgets", - "version": "v4.12.8", + "version": "v4.13.1", "source": { "type": "git", "url": "https://github.com/filamentphp/widgets.git", - "reference": "9f3b5ad3aea0f52908ee88775a890f0a50e8d903" + "reference": "3d5a4dde469ad9f8e6cb2d5928e4882f6a92afe1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/filamentphp/widgets/zipball/9f3b5ad3aea0f52908ee88775a890f0a50e8d903", - "reference": "9f3b5ad3aea0f52908ee88775a890f0a50e8d903", + "url": "https://api.github.com/repos/filamentphp/widgets/zipball/3d5a4dde469ad9f8e6cb2d5928e4882f6a92afe1", + "reference": "3d5a4dde469ad9f8e6cb2d5928e4882f6a92afe1", "shasum": "" }, "require": { @@ -2206,7 +2214,7 @@ "issues": "https://github.com/filamentphp/filament/issues", "source": "https://github.com/filamentphp/filament" }, - "time": "2026-08-31T17:01:20+00:00" + "time": "2026-09-07T18:36:33+00:00" }, { "name": "fruitcake/php-cors", @@ -2993,16 +3001,16 @@ }, { "name": "laravel/framework", - "version": "v12.69.1", + "version": "v12.69.2", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "0c07b0b1f88af44d8558ffadf66900a860f93c23" + "reference": "17d034ef1e209b63a1d3a89c90ce5e89a4eb3fc5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/0c07b0b1f88af44d8558ffadf66900a860f93c23", - "reference": "0c07b0b1f88af44d8558ffadf66900a860f93c23", + "url": "https://api.github.com/repos/laravel/framework/zipball/17d034ef1e209b63a1d3a89c90ce5e89a4eb3fc5", + "reference": "17d034ef1e209b63a1d3a89c90ce5e89a4eb3fc5", "shasum": "" }, "require": { @@ -3211,7 +3219,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2026-09-01T21:34:37+00:00" + "time": "2026-09-08T14:29:09+00:00" }, { "name": "laravel/prompts", @@ -3484,16 +3492,16 @@ }, { "name": "league/commonmark", - "version": "2.10.0", + "version": "2.10.1", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "d2d1aa8b35e072966c89bc0c66cf926e56767dc4" + "reference": "9d489ab67a02960fd8ffe624d93f751daf95439e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/d2d1aa8b35e072966c89bc0c66cf926e56767dc4", - "reference": "d2d1aa8b35e072966c89bc0c66cf926e56767dc4", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/9d489ab67a02960fd8ffe624d93f751daf95439e", + "reference": "9d489ab67a02960fd8ffe624d93f751daf95439e", "shasum": "" }, "require": { @@ -3587,7 +3595,7 @@ "type": "tidelift" } ], - "time": "2026-08-11T16:06:25+00:00" + "time": "2026-09-07T13:44:26+00:00" }, { "name": "league/config", @@ -4294,16 +4302,16 @@ }, { "name": "livewire/livewire", - "version": "v3.8.7", + "version": "v3.8.8", "source": { "type": "git", "url": "https://github.com/livewire/livewire.git", - "reference": "ff019f8f6f48b7a2315922e45a70ad8fd75d1934" + "reference": "ec19e5fb1e0b60df22ad15b901c2f7740267ba11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/livewire/livewire/zipball/ff019f8f6f48b7a2315922e45a70ad8fd75d1934", - "reference": "ff019f8f6f48b7a2315922e45a70ad8fd75d1934", + "url": "https://api.github.com/repos/livewire/livewire/zipball/ec19e5fb1e0b60df22ad15b901c2f7740267ba11", + "reference": "ec19e5fb1e0b60df22ad15b901c2f7740267ba11", "shasum": "" }, "require": { @@ -4358,7 +4366,7 @@ "description": "A front-end framework for Laravel.", "support": { "issues": "https://github.com/livewire/livewire/issues", - "source": "https://github.com/livewire/livewire/tree/v3.8.7" + "source": "https://github.com/livewire/livewire/tree/v3.8.8" }, "funding": [ { @@ -4366,7 +4374,7 @@ "type": "github" } ], - "time": "2026-08-31T15:40:46+00:00" + "time": "2026-09-07T16:02:29+00:00" }, { "name": "lukascivil/treewalker", @@ -5100,16 +5108,16 @@ }, { "name": "monolog/monolog", - "version": "3.11.0", + "version": "3.12.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "147f303310f06334f03f409e49d7ad1e275ff05a" + "reference": "72c534fc0ab181ef52d92a68382318631e301608" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/147f303310f06334f03f409e49d7ad1e275ff05a", - "reference": "147f303310f06334f03f409e49d7ad1e275ff05a", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/72c534fc0ab181ef52d92a68382318631e301608", + "reference": "72c534fc0ab181ef52d92a68382318631e301608", "shasum": "" }, "require": { @@ -5135,6 +5143,7 @@ "phpstan/phpstan-strict-rules": "^2", "phpunit/phpunit": "^10.5.17 || ^11.0.7", "predis/predis": "^1.1 || ^2", + "psr/clock": "^1.0", "rollbar/rollbar": "^4.0", "ruflin/elastica": "^7 || ^8", "symfony/mailer": "^5.4 || ^6", @@ -5153,6 +5162,7 @@ "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "psr/clock": "Required to pass a clock to the Logger and control the timestamp of log records", "rollbar/rollbar": "Allow sending log messages to Rollbar", "ruflin/elastica": "Allow sending log messages to an Elastic Search server" }, @@ -5187,7 +5197,7 @@ ], "support": { "issues": "https://github.com/Seldaek/monolog/issues", - "source": "https://github.com/Seldaek/monolog/tree/3.11.0" + "source": "https://github.com/Seldaek/monolog/tree/3.12.0" }, "funding": [ { @@ -5199,7 +5209,7 @@ "type": "tidelift" } ], - "time": "2026-09-02T12:39:56+00:00" + "time": "2026-09-09T08:34:20+00:00" }, { "name": "nesbot/carbon", @@ -12655,16 +12665,16 @@ }, { "name": "technikermathe/blade-lucide-icons", - "version": "v3.174.0", + "version": "v3.177.0", "source": { "type": "git", "url": "https://github.com/PascaleBeier/blade-lucide-icons.git", - "reference": "e22d65587b2a6f21405161f399bda8c871135724" + "reference": "22f4340ac4798ac5fdbcbce96270669b6169fe23" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PascaleBeier/blade-lucide-icons/zipball/e22d65587b2a6f21405161f399bda8c871135724", - "reference": "e22d65587b2a6f21405161f399bda8c871135724", + "url": "https://api.github.com/repos/PascaleBeier/blade-lucide-icons/zipball/22f4340ac4798ac5fdbcbce96270669b6169fe23", + "reference": "22f4340ac4798ac5fdbcbce96270669b6169fe23", "shasum": "" }, "require": { @@ -12714,9 +12724,9 @@ ], "support": { "issues": "https://github.com/PascaleBeier/blade-lucide-icons/issues", - "source": "https://github.com/PascaleBeier/blade-lucide-icons/tree/v3.174.0" + "source": "https://github.com/PascaleBeier/blade-lucide-icons/tree/v3.177.0" }, - "time": "2026-09-04T01:58:29+00:00" + "time": "2026-09-09T02:07:13+00:00" }, { "name": "thecodingmachine/safe", diff --git a/resources/views/checkout/page.blade.php b/resources/views/checkout/page.blade.php index 05e8ee9..90f5dee 100644 --- a/resources/views/checkout/page.blade.php +++ b/resources/views/checkout/page.blade.php @@ -67,8 +67,8 @@ class="bbk-checkout-tab" reminders). Optional, unticked, never required — all of it is direct marketing under ePrivacy (GR L. 3471/2006 art. 11), so it needs an explicit opt-in and checkout can't be gated on it. - Persistence + prefill from the cart is Task 2 (back-end); - data_get() here already reads it once that lands. --}} + The bool round-trips via cart.meta (see saveAddress); the proper + consent record — timestamp, policy version — is back-end Task 2. --}}