info('Fetching supported currencies from the API...'); $apiSupportedCurrencies = $this->currencyService->getSupportedCurrencies(); if (Forex::isDisabled()) { $this->error('The Currency Exchange Rate feature is disabled.'); return; } if (empty($apiSupportedCurrencies)) { $this->error('Failed to fetch supported currencies from the API.'); return; } $appSupportedCurrencies = array_keys(Currency::getCurrencies()); foreach ($appSupportedCurrencies as $appSupportedCurrency) { $isAvailable = in_array($appSupportedCurrency, $apiSupportedCurrencies, true); $currencyAttributes = [ 'code' => $appSupportedCurrency, 'name' => currency($appSupportedCurrency)->getName(), 'entity' => currency($appSupportedCurrency)->getEntity(), 'available' => $isAvailable, ]; CurrencyList::updateOrCreate( ['code' => $appSupportedCurrency], $currencyAttributes ); } $this->info('Successfully initialized currencies.'); } }