public function mergeWithMledoze($mledoze, $natural, $suffix = '_nev')
    {
        if ($mledoze->isEmpty() || $natural->isEmpty()) {
            return $mledoze->isEmpty()
                ? $this->fillMledozeFields($natural)
                : $this->natural->fillNaturalFields($mledoze);
        }

        $result = [];

        foreach ($mledoze->keys()->merge($natural->keys()) as $key) {
            $naturalValue = $natural->get($key);
            $mledozeValue = $mledoze->get($key);

            if (is_null($naturalValue) || is_null($mledozeValue)) {
                $result[$key] = $mledozeValue ?: $naturalValue;

                continue;
            }

            if ($key == 'data_sources') {
                $result[$key] = $mledozeValue->merge($naturalValue);

                continue;
            }

            if ($mledozeValue !== $naturalValue) {
                $result[$key.$suffix] = $naturalValue; // Natural Earth Vector
            }

            $result[$key] = $mledozeValue; // Natural Earth Vector
        }

        return coollect($result)->sortBy(function ($value, $key) {
            return $key;
        });
    }
public function mergeWithMledoze($mledoze, $natural, $suffix = '_nev')
    {
        if ($mledoze->isEmpty() || $natural->isEmpty()) {
            return $mledoze->isEmpty()
                ? $this->fillMledozeFields($natural)
                : $this->natural->fillNaturalFields($mledoze);
        }

        $result = [];

        foreach ($mledoze->keys()->merge($natural->keys()) as $key) {
            $naturalValue = $natural->get($key);
            $mledozeValue = $mledoze->get($key);

            if (is_null($naturalValue) || is_null($mledozeValue)) {
                $result[$key] = $mledozeValue ?: $naturalValue;

                continue;
            }

            if ($key == 'data_sources') {
                $result[$key] = $mledozeValue->merge($naturalValue);

                continue;
            }

            if ($mledozeValue !== $naturalValue) {
                $result[$key.$suffix] = $naturalValue; // Natural Earth Vector
            }

            $result[$key] = $mledozeValue; // Natural Earth Vector
        }

        return coollect($result)->sortBy(function ($value, $key) {
            return $key;
        });
    }
public function mergeWithMledoze ( $ mledoze , $ natural , $ suffix = '_nev' ) { if ( $ mledoze -> isEmpty ( ) || $ natural -> isEmpty ( ) ) { return $ mledoze -> isEmpty ( ) ? $ this -> fillMledozeFields ( $ natural ) : $ this -> natural -> fillNaturalFields ( $ mledoze ) ; } $ result = [ ] ; foreach ( $ mledoze -> keys ( ) -> merge ( $ natural -> keys ( ) ) as $ key ) { $ naturalValue = $ natural -> get ( $ key ) ; $ mledozeValue = $ mledoze -> get ( $ key ) ; if ( is_null ( $ naturalValue ) || is_null ( $ mledozeValue ) ) { $ result [ $ key ] = $ mledozeValue ? : $ naturalValue ; continue ; } if ( $ key == 'data_sources' ) { $ result [ $ key ] = $ mledozeValue -> merge ( $ naturalValue ) ; continue ; } if ( $ mledozeValue !== $ naturalValue ) { $ result [ $ key . $ suffix ] = $ naturalValue ; // Natural Earth Vector } $ result [ $ key ] = $ mledozeValue ; // Natural Earth Vector } return coollect ( $ result ) -> sortBy ( function ( $ value , $ key ) { return $ key ; } ) ; }
Merge the two countries sources.

@param \PragmaRX\Coollection\Package\Coollection $mledoze
@param \PragmaRX\Coollection\Package\Coollection $natural
@param string $suffix
@return mixed
Merge the two countries sources .