currentCompany->id; $hasDefaultCurrency = Currency::where('company_id', $companyId)->where('enabled', true)->exists(); return Currency::create([ 'name' => $name, 'code' => $code, 'rate' => $rate, 'precision' => config("money.{$code}.precision"), 'symbol' => config("money.{$code}.symbol"), 'symbol_first' => config("money.{$code}.symbol_first"), 'decimal_mark' => config("money.{$code}.decimal_mark"), 'thousands_separator' => config("money.{$code}.thousands_separator"), 'enabled' => !$hasDefaultCurrency, 'company_id' => $companyId, ]); } }