From 48ea24545a6f59a01f2284afc12fb564093ccefb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=2E=20Nagy=20Gerg=C5=91?= Date: Tue, 7 Nov 2023 21:34:23 +0100 Subject: [PATCH] wip --- src/Fields/Price.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Fields/Price.php b/src/Fields/Price.php index 95fe0bff..a356b64f 100644 --- a/src/Fields/Price.php +++ b/src/Fields/Price.php @@ -18,11 +18,11 @@ class Price extends Meta /** * Create a new price field instance. */ - public function __construct(string $label, string $modelAttribute = null, string $currency = null) + public function __construct(string $label, string $currency = null) { - parent::__construct($label, $modelAttribute); - $this->currency = $currency ?: Bazar::getCurrency(); + + parent::__construct($label, sprintf('price_%s', strtolower($this->currency))); } /** @@ -32,6 +32,8 @@ public function currency(string $value): static { $this->currency = $value; + $this->modelAttribute = sprintf('price_%s', strtolower($value)); + return $this; }