fixed #224
This commit is contained in:
@ -2,8 +2,7 @@
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Akaunting\Money\Currency;
|
||||
use App\Models\Setting\Currency as Model;
|
||||
use App\Utilities\Overrider;
|
||||
use Closure;
|
||||
|
||||
class LoadCurrencies
|
||||
@ -23,22 +22,7 @@ class LoadCurrencies
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
$currencies = Model::all();
|
||||
|
||||
foreach ($currencies as $currency) {
|
||||
if (!isset($currency->precision)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
config(['money.' . $currency->code . '.precision' => $currency->precision]);
|
||||
config(['money.' . $currency->code . '.symbol' => $currency->symbol]);
|
||||
config(['money.' . $currency->code . '.symbol_first' => $currency->symbol_first]);
|
||||
config(['money.' . $currency->code . '.decimal_mark' => $currency->decimal_mark]);
|
||||
config(['money.' . $currency->code . '.thousands_separator' => $currency->thousands_separator]);
|
||||
}
|
||||
|
||||
// Set currencies with new settings
|
||||
Currency::setCurrencies(config('money'));
|
||||
Overrider::load('currencies');
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
|
Reference in New Issue
Block a user