Skip to content

Commit 35c2a03

Browse files
committed
applied default currency to the helper
1 parent 46ec680 commit 35c2a03

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/helpers.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@ function money(mixed $amount, string $currency = null, bool $convert = null): Mo
2121
}
2222

2323
if (! function_exists('currency')) {
24-
function currency(string $currency): Currency
24+
function currency(string $currency = null): Currency
2525
{
26+
if (is_null($currency)) {
27+
/** @var string $currency */
28+
$currency = config('money.defaults.currency');
29+
}
30+
2631
return new Currency($currency);
2732
}
2833
}

0 commit comments

Comments
 (0)