You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By doing that, it is indeed sorting the list by common name, except that some countries are not sorted properly, e.g. United Kingdom, which should be placed between United Arab Emirates and United States, and instead I find it before Uganda:
There are quite a lot of other countries that are not sorted properly, see this screenshot:
Is my code wrong or is it a known issue?
The text was updated successfully, but these errors were encountered:
Hi there,
I am trying to get a list of all countries to put in a select dropdown, so I need to sort it by common name.
$countries = Countries::where('postal', '!=', '')->sortBy('name.common')->pluck('name.common', 'postal');
By doing that, it is indeed sorting the list by common name, except that some countries are not sorted properly, e.g. United Kingdom, which should be placed between United Arab Emirates and United States, and instead I find it before Uganda:
There are quite a lot of other countries that are not sorted properly, see this screenshot:
Is my code wrong or is it a known issue?
The text was updated successfully, but these errors were encountered: