New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

laralabs/get-address-io

Laravel package for getAddress.io
72,869 3
Install
composer require laralabs/get-address-io
Latest Version:2.0.2
PHP:^8.1
Laravel:10 · 11 · 12
Older releases:5 – 9
License:MIT
Last Updated:Feb 26, 2025
Links: GitHub  ·  Packagist
Maintainer: Laralabs

Stable Build CI Status

Laravel getAddress.io Package

This package allows you to easily interact with the getAddress.io API and cache full postcode results to reduce quota usage.

:rocket: Quick Start

Installation

Require the package in the composer.json of your project.

composer require laralabs/get-address-io

Publish the configuration file.

php artisan vendor:publish --tag=getaddress-config

Edit the configuration file and set your desired settings, the cache is disabled by default and you will need to set the following env variables:

GETADDRESS_API_KEY=
GETADDRESS_ADMIN_KEY=

If you have enabled the cache, make sure you run the migration:

php artisan migrate

Usage

A helper function and facade is available, choose your preferred method.

The facade is located at Laralabs\GetAddress\Facades\GetAddress

The endpoints currently supported are (support for other endpoints coming soon):

  • find
  • autocomplete
  • get

Perform a lookup using the find endpoint:

$results = get_address()->find($postcode, $property);

The $property argument is optional, just searching for a postcode will return all results for that postcode and also cache the data if the cache has been enabled.

Perform a looking using the autocomplete endpoint:

$results = get_address()->autocomplete($searchTerm, ['top' => '20']);

The second argument supports an array of parameters to send with the POST request, the example above shows setting the returned results to the maximum allowed of 20.

Perform a lookup using the get endpoint:

$results = get_address()->get($addressId);

This is used with the autocomplete endpoint to return the full address information, the $addressId argument must be the ID returned from the autocomplete response.

:speech_balloon: Support

Please raise an issue on GitHub if there is a problem.

:key: License

This is open-sourced software licensed under the MIT License.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

655,942,320 9,702
laravel/framework

The Laravel Framework.

610,364,751 34,988
laravel/tinker

Powerful REPL for the Laravel framework.

524,145,802 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

442,489,569 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

412,228,818 4,664

Version History

Version Released PHP Laravel License
2.0.2 ^8.1 ^10.0|^11.0|^12.0 MIT
2.0.1 ^8.1 ^10.0|^11.0 MIT
2.0.0 ^8.1 ^10.0 MIT
1.0.3 ^7.3|^8.0 ^5.5|^6.0|^7.0|^8.0|^9.0|^10.0 MIT
1.0.2 ^7.3|^8.0 ^5.5|^6.0|^7.0|^8.0|^9.0 MIT