Skip to content

Commit e767336

Browse files
committed
fixed #72 #75
1 parent e78d8fc commit e767336

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

config/money.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
return [
44

5+
'defaults' => [
6+
7+
'currency' => env('MONEY_DEFAULTS_CURRENCY', 'USD'),
8+
9+
],
10+
511
'currencies' => [
612

713
'AED' => [

src/helpers.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
function money(mixed $amount, string $currency = null, bool $convert = false): Money
88
{
99
if (is_null($currency)) {
10-
/** @var string $currency */
11-
$currency = env('DEFAULT_CURRENCY', 'USD');
10+
$currency = (string) config('money.defaults.currency');
1211
}
1312

1413
return new Money($amount, currency($currency), $convert);

0 commit comments

Comments
 (0)