Download the PHP package designbycode/google-maps-place-details without Composer
On this page you can find all versions of the php package designbycode/google-maps-place-details. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download designbycode/google-maps-place-details
More information about designbycode/google-maps-place-details
Files in designbycode/google-maps-place-details
Package google-maps-place-details
Short Description The Reviews class is a part of the Designbycode namespace and is used to fetch reviews, rating, and user ratings total of a place using the Google Places API. It requires a Google Maps API key and a Google Maps place ID to make requests.
License MIT
Homepage https://github.com/designbycode/google-maps-place-details
Informations about the package google-maps-place-details
Google Reviews
The Reviews class is a part of the Designbycode namespace and is used to fetch reviews, rating, and user ratings total of a place using the Google Places API. It requires a Google Maps API key and a Google Maps place ID to make requests.
Package Documentation
This package provides a simple and easy-to-use interface for fetching place details from the Google Maps Place Details API.
Please note the package only return 5 reviews at most.
If you want to fetch more reviews, please use the Google Maps Place Search API
Installation
To install the package, use composer:
Usage
To use the package, you need to provide a Google Maps API key and a place ID:
You can then fetch the full result set from the Google Maps API:
Or you can fetch specific data, such as reviews, rating, and user ratings total:
Fields
The package supports the following fields:
- reviews
- rating
- user_ratings_total
Results Class
The Results
class is responsible for handling the results of a Google Maps Place Details API request. It provides the following methods:
reviews()
: Returns an array of reviews from the API response.rating()
: Returns the rating from the API response, or null if not present.userRatingsTotal()
: Returns the total number of user ratings from the API response, or null if not present.
Example
`
Enum Class
The Field enum class is used to define the fields that can be fetched from the Google Maps Place Details API. It supports the following fields:
- reviews
- rating
- user_ratings_total
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Contributions are welcome! Please submit a pull request with your changes. Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- claudemyburgh
- All Contributors
License
The MIT License (MIT). Please see License File for more information.