Download the PHP package pralhadstha/zipcoder-laravel without Composer

On this page you can find all versions of the php package pralhadstha/zipcoder-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package zipcoder-laravel

Zipcoder Laravel

Latest Version on Packagist Total Downloads Tests

A Laravel package to resolve postal codes and zip codes to addresses. Supports multiple geocoding providers with automatic failover, built-in caching, Facade support, and publishable config.

Why Zipcoder Laravel?

Requirements

Installation

The package auto-discovers the service provider and facade. No manual registration needed.

Publish the configuration file:

Configuration

The published config file (config/zipcoder.php) has four sections:

HTTP Client

Uses Guzzle 7+ (ships with Laravel) implementing PSR-18. You can override by binding your own ClientInterface in the container.

Providers

Configure credentials for each provider:

Providers with missing credentials are automatically skipped.

Chain Order

Controls the order in which providers are attempted. The first provider to return a result wins:

Cache

Usage

Basic Lookup

Iterating Results

Checking for Results

Converting to Array

Available Providers

Provider Credentials Countries Notes
Zippopotamus None Multiple Free, no API key required. Default fallback.
GeoNames username Multiple Free account at geonames.org
Zipcodebase api_key Multiple API key from zipcodebase.com
Zipcodestack api_key Multiple API key from zipcodestack.com
JP Postal Code None Japan only Supports en and ja locales

Custom Providers

Create a class implementing Pralhad\Zipcoder\Contract\Provider:

Register it in the config:

The $client and $requestFactory are injected automatically. Extra config keys (like api_url) are passed as constructor parameters.

Caching

Caching is enabled by default with a 24-hour TTL. Results are cached per postal code and country code using Laravel's cache store.

To disable caching:

To change TTL (in seconds):

To use a specific cache store:

Facade API Reference

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome! Please see CONTRIBUTING for details.

Security

If you discover a security vulnerability, please see our Security Policy. Do not open a public issue for security vulnerabilities.

License

MIT. See LICENSE for details.


All versions of zipcoder-laravel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
pralhadstha/zipcoder-php Version ^1.0
illuminate/support Version ^10.0|^11.0|^12.0
illuminate/contracts Version ^10.0|^11.0|^12.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pralhadstha/zipcoder-laravel contains the following files

Loading the files please wait ...