From 43ce1d2105976d269a0ab32e176f5d8f5195cac0 Mon Sep 17 00:00:00 2001 From: Mazarin Date: Tue, 7 Nov 2023 16:33:58 -0500 Subject: [PATCH] feat: order currencies by code (#7009) --- .../Web/ViewHelpers/CurrencyIndexViewHelper.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Domains/Settings/ManageCurrencies/Web/ViewHelpers/CurrencyIndexViewHelper.php b/app/Domains/Settings/ManageCurrencies/Web/ViewHelpers/CurrencyIndexViewHelper.php index e1f4f7ec760..bec24ca0187 100644 --- a/app/Domains/Settings/ManageCurrencies/Web/ViewHelpers/CurrencyIndexViewHelper.php +++ b/app/Domains/Settings/ManageCurrencies/Web/ViewHelpers/CurrencyIndexViewHelper.php @@ -10,7 +10,10 @@ class CurrencyIndexViewHelper public static function data(Account $account, int $currencyId = null): Collection { $currenciesCollection = $account->currencies() - ->where('active', true)->get()->map(function ($currency) use ($currencyId) { + ->orderBy('code') + ->where('active', true) + ->get() + ->map(function ($currency) use ($currencyId) { return [ 'id' => $currency->id, 'name' => $currency->code,