sfneal/google-places

Actions & Controllers for interacting with the Google Places API through Laravel applications

1.2.1 2021-07-20 16:00 UTC

This package is auto-updated.

Last update: 2024-10-20 22:50:55 UTC


README

Packagist PHP support Latest Version on Packagist StyleCI Build Status Scrutinizer Code Quality Total Downloads

Actions & Controllers for interacting with the Google Places API through Laravel applications

Installation

You can install the package via composer:

composer require sfneal/google-places

Usage

Publish the config to overwrite env values.

php artisan vendor:publish --provider="Sfneal\Healthy\Providers\HealthyServiceProvider"

Add the routes to your application.

Route::prefix('')->group(base_path('vendor/sfneal/google-places/routes/google-places.php')); 

Autocomplete places queries by inputting a part of the place's name.

/places/city?q=boston

>>> Array
(
    [total_count] => 5
    [items] => Array
        (
            [0] => Array
                (
                    [id] => Boston, MA
                    [text] => Boston, MA
                    [place_id] => ChIJGzE9DS1l44kRoOhiASS_fHg
                )

            [1] => Array
                (
                    [id] => Boston, NY
                    [text] => Boston, NY
                    [place_id] => ChIJNfL3CvAB04kRz5mZnjI-6p0
                )

            [2] => Array
                (
                    [id] => Boston, OH
                    [text] => Boston, OH
                    [place_id] => ChIJcaM-YbLfMIgRrdGkTgGt2Og
                )

            [3] => Array
                (
                    [id] => New Boston, NH
                    [text] => New Boston, NH
                    [place_id] => ChIJDW6Uqegz4okRZT90sRNsDlk
                )

            [4] => Array
                (
                    [id] => Boston Corner, NY
                    [text] => Boston Corner, NY
                    [place_id] => ChIJU_hSBC2B3YkROSlb42LQxoM
                )

        )

)

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email stephen.neal14@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

PHP Package Boilerplate

This package was generated using the PHP Package Boilerplate.