updated money package to 5.0 version

This commit is contained in:
Denis Duliçi
2023-07-10 12:53:43 +03:00
parent 7a589e5bbd
commit 20e5b57562
26 changed files with 1887 additions and 1877 deletions

View File

@ -84,7 +84,7 @@ class Money
$amount = $item['price'];
if (strpos($item['price'], config('money.' . $currency_code . '.symbol')) !== false) {
if (strpos($item['price'], config('money.currencies.' . $currency_code . '.symbol')) !== false) {
$amount = $this->getAmount($item['price'], $currency_code);
}
@ -101,8 +101,8 @@ class Money
protected function getAmount($money_format, $currency_code)
{
try {
if (config('money.' . $currency_code . '.decimal_mark') !== '.') {
$money_format = Str::replaceFirst('.', config('money.' . $currency_code . '.decimal_mark'), $money_format);
if (config('money.currencies.' . $currency_code . '.decimal_mark') !== '.') {
$money_format = Str::replaceFirst('.', config('money.currencies.' . $currency_code . '.decimal_mark'), $money_format);
}
$amount = money($money_format, $currency_code)->getAmount();