Download the PHP package emplify-software/statamic-google-reviews without Composer

On this page you can find all versions of the php package emplify-software/statamic-google-reviews. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package statamic-google-reviews

Statamic Google Reviews

Statamic v4 Statamic v5

Display Google Reviews on your Statamic site using the Google Places API.

Features

This Statamic addon fetches Google customer reviews for one or multiple locations using the Google Places API.

[!NOTE] This addon does not require the Google My Business API, which makes it easier to set up and use.

✅ Simple configuration
✅ Supports multiple locations
✅ Reviews are cached in a collection
✅ Manual review editing and removal
✅ No client-side API calls to Google - GDPR compliant

🛠️ How to Install

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

After the addon is installed, publish the configuration file, blueprints and collections for the addon by running:

After running the publish command, you will find the configuration file at config/statamic-google-reviews.php. Since you can define all configuration options in the .env file (see Configuration), you normally do not need to edit the configuration file directly. A new collection called Google Reviews will also be created, as well as a new taxonomy called Google Review Places.

💡 How to Use

Generating an API Key for Google Places API

  1. Use an existing Google Cloud project or create a new one at Google Cloud Console.
  2. Create a new API key for the project:
    • Go to the Google Maps Platform > Credentials section and select the project.
    • Click Create credentials and select API key.
    • Under API restrictions, select Places API or Places API (New).
    • The API key will be displayed on the screen.

Configuration

  1. Add your Google Places API key to the .env file:

  2. Reviews can be retrieved with translated texts. Per default, the current app locale is used as the language for the reviews. If you want to use a different language, set GOOGLE_REVIEWS_LANGUAGE in the .env file:

  3. If you are using the legacy "Places API" (not "Places API (New)"), set GOOGLE_REVIEWS_LEGACY_API to true in the .env file:

Adding Places

The addon automatically generates a taxonomy called Google Review Places. To register a new place, follow these steps:

  1. Go to Taxonomies > Google Review Places in the control panel
  2. Click Create Term
  3. Enter a name for the place. You can name it whatever you want, e.g. "My Restaurant" or "Berlin Office".
  4. Enter the Google Place ID for the location. You can find the Place ID by searching for the location on the Place ID Finder.
  5. Click Save & Publish
  6. The latest reviews for the new place will automatically be fetched after saving the term. If the place has reviews, you will now see them under Collections > Google Reviews in the control panel.

Fetching Reviews

You can manually fetch the reviews for all registered places by running the following command:

Scheduling Review Fetching

To keep the reviews up-to-date, you can set up a scheduled task to automatically fetch the reviews at regular intervals. Like any other command, you can schedule the emplify-software:google-reviews:crawl command in the console kernel:

If you are using Laravel 11 or later, you can also directly add the schedule command to the routes/console.php file:

If the crawling command fails, it will return an error code, which can be handled in the scheduler if needed:

Removing and editing reviews

The reviews are stored in a collection called Google Reviews (Collections > Google Reviews). To remove a review, simply unpublish it.

[!NOTE] Do not completely delete reviews from the collection. Deleted reviews will be re-fetched on the next crawl.

It is also possible to edit the review content in the entry (e.g. to fix spelling mistakes or adjust the translation). To make sure the review is not overwritten on the next crawl, activate the Manual Override switch for the entry.

Displaying Reviews

You can display the reviews on your site by iterating over the Google Reviews collection using the collection:google-reviews tag:

Since the reviews are stored in a collection, you can also use the collection tag to filter and sort the reviews as needed (See https://statamic.dev/tags/collection).

Example: Only display the reviews for a specific place:

🎛️ Control Panel Utility

Under Utilities > Google Reviews, you can see the current status of the review crawlers. With the "Update Reviews" button, you can also manually trigger a fetch of all reviews.

Additionally, you can see a list of all registered places. If a place ID is incorrect or if the reviews could not be fetched for some other reason, an error message will be displayed for the place. You can also see how many reviews are locally stored for each place and how many reviews are actually available on Google (see Known Issues).

⚠️ Known Issues


All versions of statamic-google-reviews with dependencies

PHP Build Version
Package Version
Requires statamic/cms Version ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package emplify-software/statamic-google-reviews contains the following files

Loading the files please wait ....