currency->code)->get(); foreach ($currencies as $currency) { $newRate = $currencyService->getCachedExchangeRate($event->currency->code, $currency->code); if ($newRate !== null) { $currency->update(['rate' => $newRate]); } } } }