File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 4
4
5
5
'defaults ' => [
6
6
7
- 'currency ' => env ('MONEY_DEFAULTS_CURRENCY ' , 'USD ' ),
7
+ 'currency ' => env ('MONEY_DEFAULTS_CURRENCY ' , 'USD ' ),
8
+
9
+ 'convert ' => env ('MONEY_DEFAULTS_CONVERT ' , false ),
8
10
9
11
],
10
12
Original file line number Diff line number Diff line change 4
4
use Akaunting \Money \Money ;
5
5
6
6
if (! function_exists ('money ' )) {
7
- function money (mixed $ amount , string $ currency = null , bool $ convert = false ): Money
7
+ function money (mixed $ amount , string $ currency = null , bool $ convert = null ): Money
8
8
{
9
9
if (is_null ($ currency )) {
10
10
/** @var string $currency */
11
11
$ currency = config ('money.defaults.currency ' );
12
12
}
13
13
14
+ if (is_null ($ convert )) {
15
+ /** @var bool $convert */
16
+ $ convert = config ('money.defaults.convert ' );
17
+ }
18
+
14
19
return new Money ($ amount , currency ($ currency ), $ convert );
15
20
}
16
21
}
You can’t perform that action at this time.
0 commit comments