Skip to content

Commit

Permalink
Change name of symbolPlacement none to hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
pelmered committed Jul 24, 2024
1 parent 76f776b commit f741db8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion config/filament-money-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
| Currency symbol placement
|---------------------------------------------------------------------------
|
| Where the dunit should be on form fields. Options are 'before' (prefix), 'after' (suffix) or 'none'.
| Where the dunit should be on form fields. Options are 'before' (prefix), 'after' (suffix) or 'hidden'.
| Note: In most non-English speaking European countries,
| the currency symbol is after the amount and is preceded by a space (as in "10 €")
|
Expand Down
6 changes: 3 additions & 3 deletions src/Forms/Components/MoneyInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected function prepare(): void
match ($symbolPlacement) {
'before' => $this->prefix($getCurrencySymbol),
'after' => $this->suffix($getCurrencySymbol),
'none' => null,
'hidden' => null,
};

if (config('filament-money-field.use_input_mask')) {
Expand Down Expand Up @@ -92,8 +92,8 @@ public function symbolPlacement(string|Closure|null $symbolPlacement = null): st
{
$this->symbolPlacement = $this->evaluate($symbolPlacement);

if (! in_array($this->symbolPlacement, ['before', 'after', 'none'])) {
throw new \InvalidArgumentException('Symbol placement must be either "before", "after" or "none".');
if (! in_array($this->symbolPlacement, ['before', 'after', 'hidden'])) {
throw new \InvalidArgumentException('Symbol placement must be either "before", "after" or "hidden".');
}

return $this;
Expand Down

0 comments on commit f741db8

Please sign in to comment.