PHPackages                             gocanto/places-validation - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. gocanto/places-validation

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

gocanto/places-validation
=========================

validate users addresses through services like google place

0.8(8y ago)47260↓87.5%5MITPHPPHP ^7.1.3

Since Jul 8Pushed 8y ago3 watchersCompare

[ Source](https://github.com/gocanto/places-validation)[ Packagist](https://packagist.org/packages/gocanto/places-validation)[ Docs](https://github.com/gocanto/places-validation)[ RSS](/packages/gocanto-places-validation/feed)WikiDiscussions master Synced 4w ago

READMEChangelog (8)Dependencies (5)Versions (10)Used By (0)

Places Validation
=================

[](#places-validation)

[![Total Downloads](https://camo.githubusercontent.com/abe9358935e701cccef4bca491aa831d7714925e285b8e43f582d722ea314e9d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676f63616e746f2f706c616365732d76616c69646174696f6e2e737667)](https://packagist.org/packages/gocanto/places-validation)[![Build Status](https://camo.githubusercontent.com/23d64dd0b95404d9cde3e90d5d6bc83bfe6617dcba2c79441aff449e94b7a793/68747470733a2f2f7472617669732d63692e6f72672f676f63616e746f2f706c616365732d76616c69646174696f6e2e737667)](https://travis-ci.org/gocanto/places-validation)[![Latest Stable Version](https://camo.githubusercontent.com/1b0404caf1a2347d397e6ded23bb5a977fdee98dd735a2268302cad59c8f550c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f676f63616e746f2f706c616365732d76616c69646174696f6e2e737667)](https://packagist.org/packages/gocanto/places-validation)

Places validation is a ***laravel*** library that will help you out to handle your user addresses. Its aim is making sure the addresses submitted by users are valid through 3rd party services, as google.

Installation
============

[](#installation)

Begin by installing the package through Composer. Run the following command in your terminal:

```
composer require gocanto/places-validation
```

Once composer is done, add the package service provider in the providers array in `config/app.php`:

```
Gocanto\AddressValidation\ValidatorServiceProvider::class
```

Client Side
===========

[](#client-side)

`Vuejs` component which implements the google autocomplete library:

- Repository: [](https://github.com/gocanto/google-autocomplete)
- Demo: [](https://gocanto.github.io/google-autocomplete/)

Settings
========

[](#settings)

You will be able to set the validator driver into `config/addressval.php` file. At the moment, the package just has the ability to work with google, but others services are planned ahead.

The array driver looks like this:

```
'driver' => [

  //api key if required
  'key' => '',

  //driver object
  'name' => 'GeoogleGeocode',

  //api url
  'api' => 'http://maps.google.com/maps/api/geocode/json'
],
```

if you do not set the driver within this file, the default one will be used.

Validate user address using the Laravel validator object
========================================================

[](#validate-user-address-using-the-laravel-validator-object)

Now you will be able to use this package to validate the user address information within your validations rules. This is how it would look like:

```
$rules = [
  'address' => 'valid_place'
];

$data = [
  'address' => 'Guacara, Carabobo, Venezuela'
];

$v = \Validator::make($data, $rules);
```

You will be able to see the implementation on [ManagerTest](https://github.com/gocanto/places-validation/blob/master/tests/ManagerTest.php#L30-L57)

Use out of the Laravel object
=============================

[](#use-out-of-the-laravel-object)

To implement the validation within your project, you have to include the Checker object as so:

```
use Gocanto\AddressValidation\Lib\Checker;
```

then, you can let laravel to handle the dependency injection for you, as so:

```
public function index(Checker $places)
{

  if ( ! $v = $places->validate('Guacara, Carabobo, Venezuela')) {
    //the place is not valid.
  }

  //retrieve the place information.
  dd($v->retrieve(), $v->location());
}
```

***Output Illustration***

[![example](https://github.com/gocanto/places-validation/raw/dev/src/Examples/google-output.png)](https://github.com/gocanto/places-validation/blob/dev/src/Examples/google-output.png)

Inspiration
===========

[](#inspiration)

The inspiration came from a needed of using the validation within a form request object. I used [Prosper Otemuyiwa](https://github.com/unicodeveloper/laravel-password) package to have a scope of what I had to do.

Contributing
============

[](#contributing)

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.

License
=======

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

How can I thank you?
====================

[](#how-can-i-thank-you)

Why not star the github repo? Why not share the link for this repository on Twitter? Spread the word!

Don't forget to [follow me on twitter](https://twitter.com/gocanto)!

Thanks!

Gustavo Ocanto.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~85 days

Recently: every ~146 days

Total

8

Last Release

3046d ago

PHP version history (3 changes)v0.1PHP ~5.6|~7.0

0.7PHP &gt;=7.0.0

0.8PHP ^7.1.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5246059?v=4)[Gus](/maintainers/gocanto)[@gocanto](https://github.com/gocanto)

---

Top Contributors

[![gocanto](https://avatars.githubusercontent.com/u/5246059?v=4)](https://github.com/gocanto "gocanto (59 commits)")

---

Tags

googlelaravelphpplacesvalidationvalidationvalidateUsersaddressesplaces

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/gocanto-places-validation/health.svg)

```
[![Health](https://phpackages.com/badges/gocanto-places-validation/health.svg)](https://phpackages.com/packages/gocanto-places-validation)
```

###  Alternatives

[propaganistas/laravel-phone

Adds phone number functionality to Laravel based on Google's libphonenumber API.

3.0k38.3M138](/packages/propaganistas-laravel-phone)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k16.6M109](/packages/bensampo-laravel-enum)[proengsoft/laravel-jsvalidation

Validate forms transparently with Javascript reusing your Laravel Validation Rules, Messages, and FormRequest

1.1k2.3M50](/packages/proengsoft-laravel-jsvalidation)[wendelladriel/laravel-validated-dto

Data Transfer Objects with validation for Laravel applications

761621.7k17](/packages/wendelladriel-laravel-validated-dto)[wixel/gump

A fast, extensible &amp; stand-alone PHP input validation class that allows you to validate any data.

1.2k1.4M31](/packages/wixel-gump)[prettus/laravel-validation

Laravel Validation Service

40611.2M52](/packages/prettus-laravel-validation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
