antonioribeiro / countries

Laravel countries and currencies
BSD 3-Clause "New" or "Revised" License
1.82k stars 280 forks source link

Problem with United Kingdom #119

Open milosb793 opened 5 years ago

milosb793 commented 5 years ago

Hey people,

I'm facing an issue with the United Kingdom, it seems like when I pluck just common.name using:

Countries::all()->pluck('common.name');

I'm getting the United Kingdom. But when I do:

Countries::all()->pluck('common.name', 'postal');

the United Kingdom is missing... Any ideas?

DubStepMad commented 4 years ago

To be honest, I am getting the issue with getting all timezones. The UK (United Kingdom) is missing but the captial would be London.

$countries = new Countries();

            $collection = $countries->all()->hydrate('timezones')->pluck("timezones");

            $timezones = $collection->mapWithKeys(function($timezones) {
                $zones = [];

                foreach ($timezones as $timezone) {
                    $zones[$timezone['zone_id']] = $timezone;
                }

                return $zones;
            });

@antonioribeiro could you shed some light on this please.