PHPackages                             tombroucke/otomaties-google-reviews-widget - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. tombroucke/otomaties-google-reviews-widget

ActivePackage[Utility &amp; Helpers](/categories/utility)

tombroucke/otomaties-google-reviews-widget
==========================================

Display a Google reviews widget

07PHPCI failing

Since Mar 16Pushed 3mo agoCompare

[ Source](https://github.com/tombroucke/otomaties-google-reviews-widget)[ Packagist](https://packagist.org/packages/tombroucke/otomaties-google-reviews-widget)[ RSS](/packages/tombroucke-otomaties-google-reviews-widget/feed)WikiDiscussions main Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Google Reviews Widget for Acorn/Sage
====================================

[](#google-reviews-widget-for-acornsage)

A Laravel/Acorn package that displays Google My Business reviews as a beautiful widget. The widget shows the Google logo, star ratings (including half stars), average rating, and total number of reviews.

Features
--------

[](#features)

- Displays Google Business reviews with logo, stars, rating, and count
- Supports full and half star ratings
- Caches review data (default: 24 hours)
- Daily fetch command for automated updates
- Fully configurable via .env and config file
- Responsive design with mobile support

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

[](#installation)

Install the package via Composer:

```
composer require otomaties/otomaties-google-reviews-widget
```

Publish the configuration file:

```
wp acorn vendor:publish --tag="otomaties-google-reviews-widget-config"
```

Publish the CSS assets (optional):

```
wp acorn vendor:publish --tag="otomaties-google-reviews-widget-assets"
```

Configuration
-------------

[](#configuration)

### 1. Get Your Google Place ID

[](#1-get-your-google-place-id)

Find your business's Place ID:

1. Go to the [Place ID Finder](https://developers.google.com/maps/documentation/javascript/examples/places-placeid-finder)
2. Search for your business
3. Copy the Place ID (looks like: `ChIJN1t_tDeuEmsRUsoyG83frY4`)

### 2. Create a Google API Key

[](#2-create-a-google-api-key)

1. Go to [Google Cloud Console](https://console.cloud.google.com/)
2. Create a new project or select an existing one
3. Go to **APIs &amp; Services** &gt; **Library**
4. Search for and enable **"Places API"**
5. Go to **APIs &amp; Services** &gt; **Credentials**
6. Click **Create Credentials** &gt; **API Key**
7. Copy the API key
8. (Recommended) Click **Restrict Key** and limit it to "Places API" only

### 3. Configuration

[](#3-configuration)

**Add your Place ID to the config file:**

Edit `config/otomaties-google-reviews-widget.php` (publish it first if needed):

```
'place_id' => 'ChIJN1t_tDeuEmsRUsoyG83frY4',
```

**Add your API key to `.env`:**

```
# Your Google API Server Key (from step 2)
GOOGLE_API_SERVER_KEY=AIzaSyD1234567890abcdefghijklmnopqrstuv

# Optional: Cache duration in seconds (default: 86400 = 24 hours)
GOOGLE_REVIEWS_CACHE_DURATION=86400
```

### 3. Configuration File

[](#3-configuration-file)

The config file (`config/otomaties-google-reviews-widget.php`) allows you to customize display settings:

```
'display' => [
    'show_logo' => true,   // Show Google logo
    'show_stars' => true,  // Show star ratings
    'show_rating' => true, // Show average rating number
    'show_count' => true,  // Show review count
],
```

Usage
-----

[](#usage)

### Display the Widget

[](#display-the-widget)

**Using Shortcode:**

```
[google_reviews_widget]

```

**Using Blade:**

```
@include('GoogleReviewsWidget::widget')
```

Don't forget to include the CSS file in your theme:

```

```

### Fetch Reviews

[](#fetch-reviews)

Manually fetch the latest reviews:

```
wp acorn google-reviews:fetch
```

### Schedule Daily Updates

[](#schedule-daily-updates)

Add to your `app/Console/Kernel.php`:

```
protected function schedule(Schedule $schedule)
{
    $schedule->command('google-reviews:fetch')->daily();
}
```

Or set up a cron job:

```
0 2 * * * cd /path/to/your/site && wp acorn google-reviews:fetch
```

### Programmatic Usage

[](#programmatic-usage)

You can also use the service directly in your code:

```
use Otomaties\GoogleReviewsWidget\Services\GoogleReviewsService;

$service = new GoogleReviewsService();

// Get cached reviews
$reviews = $service->getReviews();

// Fetch fresh reviews
$reviews = $service->fetchReviews();

// Get star rating breakdown
$stars = $service->getStarRating(4.5);
// Returns: ['full' => 4, 'half' => 1, 'empty' => 0]
```

Community
---------

[](#community)

Keep track of development and community news.

- Join us on Discord by [sponsoring us on GitHub](https://github.com/sponsors/roots)
- Join us on [Roots Discourse](https://discourse.roots.io/)
- Follow [@rootswp on Twitter](https://twitter.com/rootswp)
- Follow the [Roots Blog](https://roots.io/blog/)
- Subscribe to the [Roots Newsletter](https://roots.io/subscribe/)

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance54

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

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/4178291ccf36e3530aa8a8845124c3af1b24c064739ad98ded5b9679a4316033?d=identicon)[tombroucke](/maintainers/tombroucke)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/tombroucke-otomaties-google-reviews-widget/health.svg)

```
[![Health](https://phpackages.com/badges/tombroucke-otomaties-google-reviews-widget/health.svg)](https://phpackages.com/packages/tombroucke-otomaties-google-reviews-widget)
```

###  Alternatives

[eve/dto

Simplistic, flexible Data Transfer Object library

1214.8k](/packages/eve-dto)[elegantly/laravel-kpi

Advanced KPI for your Laravel application

174.4k1](/packages/elegantly-laravel-kpi)

PHPackages © 2026

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