protected static function getWorldContries($only_names = false) : Collection
    {
        $file = __DIR__ . "/../Assets/topojson/world-countries.json";

        return Collection::make(
            json_decode(file_get_contents($file), true)['objects']['countries1']['geometries']
        )->map(function ($country) use ($only_names) {
            if ($only_names) {
                return $country['properties']['name'];
            }
            return $country['properties'];
        });
    }
protected static function getWorldContries($only_names = false) : Collection
    {
        $file = __DIR__ . "/../Assets/topojson/world-countries.json";

        return Collection::make(
            json_decode(file_get_contents($file), true)['objects']['countries1']['geometries']
        )->map(function ($country) use ($only_names) {
            if ($only_names) {
                return $country['properties']['name'];
            }
            return $country['properties'];
        });
    }
protected static function getWorldContries ( $ only_names = false ) : Collection { $ file = __DIR__ . "/../Assets/topojson/world-countries.json" ; return Collection :: make ( json_decode ( file_get_contents ( $ file ) , true ) [ 'objects' ] [ 'countries1' ] [ 'geometries' ] ) -> map ( function ( $ country ) use ( $ only_names ) { if ( $ only_names ) { return $ country [ 'properties' ] [ 'name' ] ; } return $ country [ 'properties' ] ; } ) ; }
Return the all world countries.

@author Erik Campobadal Fores <soc@erik.cat>
@copyright 2017 erik.cat
@param boolean $only_names
@return Collection
Return the all world countries .