Download the PHP package skagarwal/google-places-api without Composer

On this page you can find all versions of the php package skagarwal/google-places-api. 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 google-places-api

Latest Stable Version Total Downloads License

Google Places API for PHP

A PHP wrapper for Google Places API Web Service, compatible with Laravel.

Version Compatibility

Package Version PHP Laravel Google Places API
^3.0 ^8.1 ^10 | ^11 Places API and Places API (New)
^2.2 ^8.0.2 ^9 | ^10 | ^11 Places API

[!CAUTION] Version 3 is a complete rewrite using Saloon with breaking changes.
v2.2 API is deprecated and will be removed in next major version. Which means it is backward compatible.
And it is recommended to shift to v3 API before next major release.
You can refer to v2.2 documentation here.

Installation

Install it with composer

General Usage

Laravel user can see the Laravel Usage section

You can also set the API KEY after initiating the class using GooglePlaces::make()->setKey('KEY') method.


Laravel

Step 1

publish the config file with following artisan command

This will create google.php file in the config directory.

Set the API KEY in this config file.

Step 2

Start making requests


Response

The response returned is a Saloon's Response thus you can use all the methods provided by Saloon.

You can refer to Saloon's documentation for more methods.

[!IMPORTANT]
By default, no exception is thrown for API errors. You can check the request status with $response->status().
You can also use GooglePlaces::make()->findPlace()->throw() to throw an exception if the request fails.


API Reference

This library supports both the Places API (New).

Places API

This section covers methods available for original Places API.

Place Search

findPlace(string $input, string $inputType, array $params = [])

nearbySearch(string $location, ?string $radius = null, array $params = [])

textSearch(string $query, array $params = [])


Place Details

placeDetails(string $placeId, array $params = [])


Place Autocomplete

placeAutocomplete(string $input, array $params = [])


Query Autocomplete

queryAutocomplete(string $input, array $params = [])


Place Photo

photo(string $photoReference, array $params = [])


Places API (New)

This section covers methods available for Places API (New).


Autocomplete

autocomplete(string $input, bool $includeQueryPredictions = false, ?array $fields = null, array $params = [])

Nearby Search

nearbySearch(float $latitude, float $longitude, float $radius = 0.0, array $fields = ['*'], array $params = [])

Place Details

placeDetails(string $placeId, array $fields = ['*'], array $params = [])

Text Search

textSearch(string $textQuery, array $fields = ['*'], array $params = [])

Place Photo

placePhoto(string $name, int $maxHeightPx = null, int $maxWidthPx = null)


Custom Headers

Set Custom Headers


Additional Methods


Contribution


License

This package is licensed under the MIT License.


All versions of google-places-api with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^10.0|^11.0
illuminate/container Version ^10.0|^11.0
guzzlehttp/guzzle Version ^7.5
saloonphp/saloon Version ^3.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 skagarwal/google-places-api contains the following files

Loading the files please wait ....