public function scopeAddCountryInfo($query)
    {
        $table = 'geonames_geonames';

        if (!isset($query->getQuery()->columns))
            $query = $query->addSelect($this->usefulScopeColumns);

        $query = $query
            ->leftJoin('geonames_country_infos as country_info', $table . '.country_code', '=',
                'country_info.iso'
            )
            ->addSelect(
                'country_info.geoname_id as country_info_geoname_id',
                'country_info.country as country_info_country'
            );

        return $query;
    }
public function scopeAddCountryInfo($query)
    {
        $table = 'geonames_geonames';

        if (!isset($query->getQuery()->columns))
            $query = $query->addSelect($this->usefulScopeColumns);

        $query = $query
            ->leftJoin('geonames_country_infos as country_info', $table . '.country_code', '=',
                'country_info.iso'
            )
            ->addSelect(
                'country_info.geoname_id as country_info_geoname_id',
                'country_info.country as country_info_country'
            );

        return $query;
    }
public function scopeAddCountryInfo ( $ query ) { $ table = 'geonames_geonames' ; if ( ! isset ( $ query -> getQuery ( ) -> columns ) ) $ query = $ query -> addSelect ( $ this -> usefulScopeColumns ) ; $ query = $ query -> leftJoin ( 'geonames_country_infos as country_info' , $ table . '.country_code' , '=' , 'country_info.iso' ) -> addSelect ( 'country_info.geoname_id as country_info_geoname_id' , 'country_info.country as country_info_country' ) ; return $ query ; }
Return country information in result

@param \Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder $query
@return \Illuminate\Database\Query\Builder
Return country information in result