Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ziptastic/ziptastic-php-fluent
This is an ziptastic client for php using guzzle with two ways to use it.
https://github.com/ziptastic/ziptastic-php-fluent
forward geocode geodata gis guzzle postal-code reverse reverse-geocoding zipcode ziptastic ziptastic-php
Last synced: about 1 month ago
JSON representation
This is an ziptastic client for php using guzzle with two ways to use it.
- Host: GitHub
- URL: https://github.com/ziptastic/ziptastic-php-fluent
- Owner: Ziptastic
- Created: 2016-03-29T14:06:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-05T06:51:45.000Z (about 7 years ago)
- Last Synced: 2024-11-14T20:49:26.448Z (about 1 month ago)
- Topics: forward, geocode, geodata, gis, guzzle, postal-code, reverse, reverse-geocoding, zipcode, ziptastic, ziptastic-php
- Language: PHP
- Homepage: https://getziptastic.com
- Size: 33.2 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ziptastic PHP with Guzzle
This package was brought into existence because of [this package](https://github.com/Ziptastic/ziptastic-php), specifically because of the [first enhancement](https://github.com/Ziptastic/ziptastic-php/issues/1)
This library is a [Guzzle](http://docs.guzzlephp.org/en/latest/) based interface for the [Ziptastic API](https://getziptastic.com/).
Using Ziptastic requires an API key, you can get one by signing up with Ziptastic.
## Installing
Ziptastic PHP can be installed via composer:
````
composer require ziptastic/fluent
````## Usage
There are two different ways to use this package with the same end result.
The first way to use this is by using `Zipper` which will be using a more "plain english" oriented syntax
````php
in('US')->withPostalCode(48867)->andWithKey($key)->find();
echo $results->response;
?>
````If that isn't your cup of tea or you just want to get things done, you can use `Ziptastic`
````php
setKey($key)->find();echo $results->response;
?>
````## Using results
If you wanted to, you can access any and all of the results of the api call via calling the item you want from the api response.
The first way to use this is by using `Zipper` which will be using a more "plain english" oriented syntax
````php
in('US')->withPostalCode(48867)->andWithKey($key)->find();
echo $results->city, ', ',$results->state,' ',$results->postal_code;
?>
````
And in that example the only one set by default is the postal code, the others are from the response.Ziptastic PHP is licensed under the [MIT license](https://opensource.org/licenses/MIT/).