PHPackages                             maree/google-geo-services - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. maree/google-geo-services

ActiveLibrary[API Development](/categories/api)

maree/google-geo-services
=========================

get google places ,cities,address,path, distance and currency converter by google api

24PHP

Since Mar 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/mohamedmaree/GoogleGeoService)[ Packagist](https://packagist.org/packages/maree/google-geo-services)[ RSS](/packages/maree-google-geo-services/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

google-geo-services
===================

[](#google-geo-services)

Installation
------------

[](#installation)

You can install the package via [Composer](https://getcomposer.org).

```
composer require maree/google-geo-services
```

Publish your google-geo-services config file with

```
php artisan vendor:publish --provider="maree\googleGeoServices\googleGeoServiceProvider" --tag="google-geo-services"
```

then change your google api key config from config/google-geo-services.php file

Usage
-----

[](#usage)

nearGooglePlaces
----------------

[](#neargoogleplaces)

- To get near google places from specified point
- you can define category by pass the value in $category key EX : 'Restaurant or Store'
- you can define place by pass the value in $category key EX : 'kfc or Macdonalds'
- must insert valid google key in config/google-geo-services.php to return valid result

```
use maree\googleGeoServices\GoogleGeoService;

GoogleGeoService::nearGooglePlaces($latitude='', $longitude='',$category='',$lang='ar',$next_page_token='');
```

- note : you can get next page of array of places by pass the value of 'next\_page\_token' return in response.
- note : that api cost much money from google places api so that if you return the same places or area every time
- run that service
- save response places in local database
- in next time check first if places exists in local database use it else if that new area run the service and save places in database to use it next time

directDistance
--------------

[](#directdistance)

- directDistance
- To get direct line between two points not 'road or way' but 'direct line'
- distance return in KM
- note: doesn't use google key here

```
use maree\googleGeoServices\GoogleGeoService;

GoogleGeoService::directDistance( $latitudeFrom, $longitudeFrom, $latitudeTo, $longitudeTo);
```

getAddressBylatlng
------------------

[](#getaddressbylatlng)

- To get address by coordinates
- must insert valid google key in config/google-geo-services.php to return valid result

```
use maree\googleGeoServices\GoogleGeoService;

GoogleGeoService::getAddressBylatlng($lat = '' ,$long = '', $lang = 'ar');
```

getCityBylatlng
---------------

[](#getcitybylatlng)

- To get City short name by coordinates
- must insert valid google key in config/google-geo-services.php to return valid result

```
use maree\googleGeoServices\GoogleGeoService;

GoogleGeoService::getCityBylatlng($lat = '' ,$long = '', $lang = 'ar');
```

GetDrivingDistance
------------------

[](#getdrivingdistance)

- To get shortest road distance and time between two points
- must insert valid google key in config/google-geo-services.php to return valid result

```
use maree\googleGeoServices\GoogleGeoService;

GoogleGeoService::GetDrivingDistance($lat1='', $long1='',$lat2='', $long2='',$lang ='ar' ,$mode='driving');
```

- note :available modes driving|walking|bicycling|transit

GetPathAndDirections
--------------------

[](#getpathanddirections)

- To get road distance and time between two points when define points in that road
- must insert valid google key in config/google-geo-services.php to return valid result

```
use maree\googleGeoServices\GoogleGeoService;

GoogleGeoService::GetPathAndDirections($lat1='', $long1='',$lat2='', $long2='' ,$path='',$lang ='ar',$mode='driving');
```

- note :available modes driving|walking|bicycling|transit
- note : add path as string with '|' between points like $path = '31.0345612,31.3489804|31.0328805,31.36542648'

currentCountry
--------------

[](#currentcountry)

- To get current country by request IP address not geolocation no need for google api key

```
use maree\googleGeoServices\GoogleGeoService;

GoogleGeoService::currentCountry();
```

convertCurrency
---------------

[](#convertcurrency)

- To convert amount of money from currency to another
- must insert valid currency converter api key in config/google-geo-services.php to return valid result

```
use maree\googleGeoServices\GoogleGeoService;

GoogleGeoService::convertCurrency($amount =10 ,$from_currency='USD',$to_currency='EGP');
```

praytime
--------

[](#praytime)

- To get muslims pray times by area geolocation no need for google api key

```
use maree\googleGeoServices\GoogleGeoService;

GoogleGeoService::praytime($from_lat='',$from_long='');
```

current available services :
----------------------------

[](#current-available-services-)

- nearGooglePlaces
- directDistance
- getAddressBylatlng
- getCityBylatlng
- GetDrivingDistance
- GetPathAndDirections
- currentCountry
- convertCurrency
- praytime

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e88e6da55b1e4b359544c3e94fab80c6f73b3ce7ac82afd1d872a41aeb349fa?d=identicon)[mohamedmaree](/maintainers/mohamedmaree)

---

Top Contributors

[![mohamedmaree](https://avatars.githubusercontent.com/u/12659069?v=4)](https://github.com/mohamedmaree "mohamedmaree (11 commits)")

### Embed Badge

![Health badge](/badges/maree-google-geo-services/health.svg)

```
[![Health](https://phpackages.com/badges/maree-google-geo-services/health.svg)](https://phpackages.com/packages/maree-google-geo-services)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M479](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
