Can not remove default currency. #11tvzng

This commit is contained in:
Cüneyt Şentürk
2021-10-05 13:50:48 +03:00
parent 3c71560d46
commit 8e5abbf743
2 changed files with 27 additions and 12 deletions

View File

@ -128,6 +128,12 @@ class Settings extends Controller
}
if ($real_key == 'default.currency') {
$currencies = Currency::enabled()->pluck('code')->toArray();
if (!in_array($value, $currencies)) {
continue;
}
$currency = Currency::code($value)->first();
$currency->rate = '1';
$currency->save();