PHPackages                             lquintana/google-places-popular-times - 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. lquintana/google-places-popular-times

ActiveLibrary[API Development](/categories/api)

lquintana/google-places-popular-times
=====================================

Get google places with its own pupular time for Laravel &gt;= 5.8

v1.0.1(5y ago)4186MITPHP

Since Mar 1Pushed 5y ago2 watchersCompare

[ Source](https://github.com/1quintana/google-places-popular-times)[ Packagist](https://packagist.org/packages/lquintana/google-places-popular-times)[ Docs](https://github.com/1quintana/google-popular-time)[ RSS](/packages/lquintana-google-places-popular-times/feed)WikiDiscussions master Synced yesterday

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

GooglePopularTime for Laravel
=============================

[](#googlepopulartime-for-laravel)

[![The MIT License](https://camo.githubusercontent.com/b37fbf1d9e70438f48ceb1f4a3f73d8f612d2aae4f84559738bdfa19f191edbf/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d6f72616e67652e7376673f7374796c653d666c61742d737175617265)](http://opensource.org/licenses/MIT)[![Latest Version on Packagist](https://camo.githubusercontent.com/f32144eec56dd184cb897df2a1d5fca9083d3a019b61fd1b506843fe2c807e27/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c7175696e74616e612f676f6f676c652d706c616365732d706f70756c61722d74696d65732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lquintana/google-places-popular-times)[![Total Downloads](https://camo.githubusercontent.com/ad6af97f2d2a35c837d707692faba7e94229b09aa1a50cee0fad085b83d7ce87/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c7175696e74616e612f676f6f676c652d706c616365732d706f70756c61722d74696d65732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lquintana/google-places-popular-times)[![Laravel](https://github.com/1quintana/google-places-popular-times/workflows/Laravel/badge.svg)](https://github.com/1quintana/google-places-popular-times/workflows/Laravel/badge.svg)

Introduction
------------

[](#introduction)

Using this package you can get a list of places with its popular times or also a place details with its popular times. Time and percentage of popularity for certain time is also included in the results.

Follow the google API documentation to understand their requirements and use this package

Requirements
------------

[](#requirements)

- &gt;= PHP 7.1
- &gt;= Laravel 5.8

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

[](#installation)

Via Composer

```
$ composer require lquintana/google-places-popular-times
```

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

[](#configuration)

You need to create a google key from the google console give it the rigth permisions to use places API. Add the following variables to the .env file in your project Laravel and replace the string YOUR-GOOGLE-KEY for the google key.

```
GOOGLE_API_KEY=YOUR-GOOGLE-KEY
```

Publish the config file with following artisan command

```
php artisan vendor:publish --tag="googlepopulartimes"
```

Usage
-----

[](#usage)

Here there is an example of url when trying to get a list of popular places. `http://places.test/api/places?location=26.189774,-80.103775&radius=5000&keyword=restaurants`

You should add the route places to route/api.php or create the route in any convinient location for your project

@ This is an example of my controller in Laravel. You can find the method index which will list places with its own popular time for each of them

```
