Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Nov 7, 2023
1 parent 3590dd1 commit 48ea245
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Fields/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}

/**
Expand All @@ -32,6 +32,8 @@ public function currency(string $value): static
{
$this->currency = $value;

$this->modelAttribute = sprintf('price_%s', strtolower($value));

return $this;
}

Expand Down

0 comments on commit 48ea245

Please sign in to comment.