PHPackages                             spotonlive/php-google-my-business - 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. spotonlive/php-google-my-business

ActiveLibrary[API Development](/categories/api)

spotonlive/php-google-my-business
=================================

Google MyBusiness

4.5.2(6y ago)31677.1k—4.2%25[11 issues](https://github.com/spotonlive/php-google-my-business/issues)Apache-2.0PHP

Since Jul 17Pushed 6y ago4 watchersCompare

[ Source](https://github.com/spotonlive/php-google-my-business)[ Packagist](https://packagist.org/packages/spotonlive/php-google-my-business)[ Docs](https://github.com/spotonlive/php-google-my-business)[ RSS](/packages/spotonlive-php-google-my-business/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (1)Versions (7)Used By (0)

php-google-my-business
======================

[](#php-google-my-business)

Google MyBusiness

Examples
--------

[](#examples)

### Creating a new post

[](#creating-a-new-post)

```
$post_body = new \Google_Service_MyBusiness_LocalPost;
$post_body->setLanguageCode('en');
$post_body->setSummary('test'); // post text
$call = new \Google_Service_MyBusiness_CallToAction;
$call->setActionType('LEARN_MORE'); // call to action type, see https://developers.google.com/my-business/content/posts-data#call_to_action_posts
$call->setUrl('https://xxxxxx'); // URL to link to
$post_body->setCallToAction($call);
$media = new \Google_Service_MyBusiness_MediaItem;
$media->setMediaFormat('PHOTO');
$media->setSourceUrl('https://example.com/whatever.jpg'); // needs to be 10+k, GIFs are *not* supported
$post_body->setMedia($media);
$accounts = $service->accounts->listAccounts()->getAccounts(); // get accounts
$locations = $service->accounts_locations->listAccountsLocations($accounts[0]['name']); // get locations under first account
$service->accounts_locations_localPosts->create($locations[0]['name'], $post_body); // create post for the location

```

### Pulling metrics for location

[](#pulling-metrics-for-location)

```
$accounts = $service->accounts->listAccounts()->getAccounts();
$locations = $service->accounts_locations->listAccountsLocations($accounts[0]['name']); // get locations for the first account
$request = new \Google_Service_MyBusiness_ReportLocationInsightsRequest;
$request->setLocationNames($locations[0]['name']); // set first location to pull data for
$actions = new \Google_Service_MyBusiness_BasicMetricsRequest;
$actions->setMetricRequests(['metric' => 'ALL']);
$time = new \Google_Service_MyBusiness_TimeRange;
$time->setStartTime('2019-10-02T15:01:23.045123456Z');
$time->setEndTime('2020-01-31T15:01:23.045123456Z');
$actions->setTimeRange($time);
$request->setBasicRequest($actions);
$insights = $service->accounts_locations->reportInsights($accounts[0]['name'], $request);
print_r($insights); // see object result structure / insights available

```

### Driving metrics for a location

[](#driving-metrics-for-a-location)

```
$locations = $service->accounts_locations->listAccountsLocations($accounts[0]['name']);
$request = new \Google_Service_MyBusiness_ReportLocationInsightsRequest;
$request->setLocationNames($locations[0]['name']);
$driving = new \Google_Service_MyBusiness_DrivingDirectionMetricsRequest;
$driving->setNumDays(90);
$request->setDrivingDirectionsRequest($driving);
$insights = $service->accounts_locations->reportInsights($accounts[0]['name'], $request);
print_r($insights);

```

### Other examples

[](#other-examples)

```
$media = $service->accounts_locations_media->listAccountsLocationsMedia($locations[0]['name']); // media
$questions=$service->accounts_locations_questions->listAccountsLocationsQuestions($locations[0]['name'])); // questions
$notifications=$service->accounts->getNotifications($locations[0]['name'])); // get notifications
$recommended=$service->accounts->listRecommendGoogleLocations($accounts[0]['name']); // recommended locations
$admins=$service->accounts_admins->listAccountsAdmins($accounts[0]['name'])); // only for business account, not PERSON account
$reviews=$service->accounts_locations_reviews->listAccountsLocationsReviews($locations[0]['name'])); // get reviews

```

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity50

Moderate usage in the ecosystem

Community20

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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.

###  Release Activity

Cadence

Every ~203 days

Recently: every ~218 days

Total

6

Last Release

2212d ago

Major Versions

3.0.0 → 4.0.02017-12-07

### Community

Maintainers

![](https://www.gravatar.com/avatar/e72d777f8a49c3da353ac451ef2b5e8d79d82ecc95f9a8649d1b3886cae31a30?d=identicon)[spotonlive](/maintainers/spotonlive)

---

Top Contributors

[![nikolajlovenhardt](https://avatars.githubusercontent.com/u/3541622?v=4)](https://github.com/nikolajlovenhardt "nikolajlovenhardt (8 commits)")[![nekromoff](https://avatars.githubusercontent.com/u/8550349?v=4)](https://github.com/nekromoff "nekromoff (6 commits)")[![aprat84](https://avatars.githubusercontent.com/u/39481795?v=4)](https://github.com/aprat84 "aprat84 (5 commits)")[![GuardsmanPanda](https://avatars.githubusercontent.com/u/19493581?v=4)](https://github.com/GuardsmanPanda "GuardsmanPanda (4 commits)")[![FdeQuillettes](https://avatars.githubusercontent.com/u/12559832?v=4)](https://github.com/FdeQuillettes "FdeQuillettes (1 commits)")[![gsouf](https://avatars.githubusercontent.com/u/3215399?v=4)](https://github.com/gsouf "gsouf (1 commits)")

---

Tags

google-my-businessphpgoogle my businessmybusinessgmb

### Embed Badge

![Health badge](/badges/spotonlive-php-google-my-business/health.svg)

```
[![Health](https://phpackages.com/badges/spotonlive-php-google-my-business/health.svg)](https://phpackages.com/packages/spotonlive-php-google-my-business)
```

###  Alternatives

[bronhy/google-my-business-php-client

Google My Business

23118.8k](/packages/bronhy-google-my-business-php-client)[revolution/laravel-google-sheets

Google Sheets API v4

4483.1M6](/packages/revolution-laravel-google-sheets)[pulkitjalan/google-apiclient

Google api php client wrapper with Cloud Platform and Laravel support

2582.9M5](/packages/pulkitjalan-google-apiclient)[dacastro4/laravel-gmail

Gmail API package for Laravel

312382.9k1](/packages/dacastro4-laravel-gmail)[scottybo/laravel-google-my-business

A package for Laravel which implements the Google My Business API

3360.3k](/packages/scottybo-laravel-google-my-business)[happyr/google-api-bundle

A Symfony2 Wrapper for the Google APIs Client Library for PHP

48196.1k](/packages/happyr-google-api-bundle)

PHPackages © 2026

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