{"id":17473866,"url":"https://github.com/gocanto/places-validation","last_synced_at":"2025-07-29T21:42:30.224Z","repository":{"id":62511643,"uuid":"62824256","full_name":"gocanto/places-validation","owner":"gocanto","description":"Laravel package to allow users addresses validation","archived":false,"fork":false,"pushed_at":"2018-02-25T13:06:29.000Z","size":246,"stargazers_count":45,"open_issues_count":0,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-23T23:06:10.834Z","etag":null,"topics":["google","laravel","php","places","validation"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gocanto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-07T17:05:45.000Z","updated_at":"2024-09-26T02:47:06.000Z","dependencies_parsed_at":"2022-11-02T10:16:35.959Z","dependency_job_id":null,"html_url":"https://github.com/gocanto/places-validation","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/gocanto/places-validation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocanto%2Fplaces-validation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocanto%2Fplaces-validation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocanto%2Fplaces-validation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocanto%2Fplaces-validation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gocanto","download_url":"https://codeload.github.com/gocanto/places-validation/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gocanto%2Fplaces-validation/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264578425,"owners_count":23631544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google","laravel","php","places","validation"],"created_at":"2024-10-18T18:07:30.650Z","updated_at":"2025-07-29T21:42:30.164Z","avatar_url":"https://github.com/gocanto.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Places Validation\n\n\u003ca href=\"https://packagist.org/packages/gocanto/places-validation\"\u003e\u003cimg src=\"https://img.shields.io/packagist/dt/gocanto/places-validation.svg\" alt=\"Total Downloads\"\u003e\u003c/a\u003e\n\u003ca href=\"https://travis-ci.org/gocanto/places-validation\"\u003e\u003cimg src=\"https://travis-ci.org/gocanto/places-validation.svg\" alt=\"Build Status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://packagist.org/packages/gocanto/places-validation\"\u003e\u003cimg src=\"https://img.shields.io/packagist/v/gocanto/places-validation.svg\" alt=\"Latest Stable Version\"\u003e\u003c/a\u003e\n\n\nPlaces 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.\n\n# Installation\n\nBegin by installing the package through Composer. Run the following command in your terminal:\n\n```bash\ncomposer require gocanto/places-validation\n```\n\nOnce composer is done, add the package service provider in the providers array in `config/app.php`:\n\n```php\nGocanto\\AddressValidation\\ValidatorServiceProvider::class\n```\n\n\n# Client Side\n\n```Vuejs``` component which implements the google autocomplete library:\n\n* Repository: \u003ca href=\"https://github.com/gocanto/google-autocomplete\" _target=\"blank\"\u003ehttps://github.com/gocanto/google-autocomplete\u003c/a\u003e\n* Demo: \u003ca href=\"https://gocanto.github.io/google-autocomplete/\" _target=\"blank\"\u003ehttps://gocanto.github.io/google-autocomplete/\u003c/a\u003e\n\n\n# Settings\n\nYou 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.\n\n\nThe array driver looks like this:\n```php\n'driver' =\u003e [\n\n  //api key if required\n  'key' =\u003e '',\n\n  //driver object\n  'name' =\u003e 'GeoogleGeocode',\n\n  //api url\n  'api' =\u003e 'http://maps.google.com/maps/api/geocode/json'\n],\n```\n\nif you do not set the driver within this file, the default one will be used.\n\n\n# Validate user address using the Laravel validator object\n\nNow 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:\n\n```php\n$rules = [\n  'address' =\u003e 'valid_place'\n];\n\n$data = [\n  'address' =\u003e 'Guacara, Carabobo, Venezuela'\n];\n\n$v = \\Validator::make($data, $rules);\n```\n\nYou will be able to see the implementation on \u003ca href=\"https://github.com/gocanto/places-validation/blob/master/tests/ManagerTest.php#L30-L57\" target=\"_blank\"\u003eManagerTest\u003c/a\u003e\n\n\n# Use out of the Laravel object\n\nTo implement the validation within your project, you have to include the Checker object as so:\n```php\nuse Gocanto\\AddressValidation\\Lib\\Checker;\n```\n\n\nthen, you can let laravel to handle the dependency injection for you, as so:\n```php\npublic function index(Checker $places)\n{\n\n  if ( ! $v = $places-\u003evalidate('Guacara, Carabobo, Venezuela')) {\n    //the place is not valid.\n  }\n\n  //retrieve the place information.\n  dd($v-\u003eretrieve(), $v-\u003elocation());\n}\n```\n\n\n***Output Illustration***\n\n![example](https://github.com/gocanto/places-validation/blob/dev/src/Examples/google-output.png)\n\n\n# Inspiration\n\nThe 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.\n\n\n# Contributing\n\nPlease feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.\n\n\n# License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n\n# How can I thank you?\nWhy not star the github repo? Why not share the link for this repository on Twitter? Spread the word!\n\n\nDon't forget to [follow me on twitter](https://twitter.com/gocanto)!\n\nThanks!\n\nGustavo Ocanto.\ngustavoocanto@gmail.com\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgocanto%2Fplaces-validation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgocanto%2Fplaces-validation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgocanto%2Fplaces-validation/lists"}