newtz / zipcode
Will allow you to find worldwide address by passing a zipcode
Installs: 4
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
pkg:composer/newtz/zipcode
Requires
- level-2/dice: ^4.0
Requires (Dev)
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2025-10-28 14:52:49 UTC
README
You will be able to get information about zipCode by instantiate your searcher.
🚀 Getting Started
Prerequisites
composer
php 7.0 >=
🔃 Installing
run
composer require newtz/zipcode
After that just import the class ZipCode
use ZipCode\ZipCode;
✅ Usage
ZipCode::getSearcher() expects a country abbreviation. If none is passed it will search in Brazil.
$searcher= ZipCode::getSearcher('US');
$searcher->find('90210');
echo $searcher->address;
output: Beverly Hills - California. 34.0901, -118.4065.
$searcher->address->street - available to Brazil searches otherwise is null
$searcher->address->state - available in all searches
$searcher->address->city - available in all searches
$searcher->address->neighborhood - available in Brazil searches otherwise is null
$searcher->address->latitude - available in WorldWide searches otherwise is null
$searcher->address->longitude - available in WorldWide searches otherwise is null
🤔 Contributing
To get started...
Step 1
- 🍴 Fork this repo!
Step 2
- 👯 Clone this repo to your local machine using
https://github.com/Newtz/ZipCodeSearcher
Step 3
- 🎋 Create your feature branch using
git checkout -b my-feature
Step 4
- ✅ Commit your changes using
git commit -m 'feat: My new feature';
Step 5
- 📌 Push to the branch using
git push origin my-feature;
Step 6
- 🔃 Create a new pull request
After your Pull Request is merged, can you delete your feature branch.
✅ Tests
To run the tests execute the command
./vendor/bin/phpunit --process-isolation
Authors
License
This project is licensed under the MIT License