PHP code example of ashleighsims / get-address-wrapper

1. Go to this page and download the library: Download ashleighsims/get-address-wrapper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ashleighsims / get-address-wrapper example snippets


AshleighSims\GetAddressWrapper\Laravel\GetAddressWrapperServiceProvider::class

'GetAddress' => AshleighSims\GetAddressWrapper\Laravel\GetAddressWrapperServiceProvider::class

use AshleighSims\GetAddressWrapper\GetAddressWrapper;
...

private $getAddress;

public function __construct(GetAddressWrapper $getAddress) {
    $this->getAddress = $getAddress;
}

public function getPostcodeAddressList() {
    $response = $this->getAddress->findByPostcode()->find('SW1A 1AA');
}

...

use AshleighSims\GetAddressWrapper\Laravel\Facades\GetAddressWrapper;

...

public function getAddress() {
    $response = GetAddressWrapper::findByPostcode()->find('SW1A 1AA');
}

...

$getAddress = new GetAddressWrapper('api-key', 'admin-api-key', 'google-places-api-key', 'https://api.getAddress.io');
$response = $getAddress->findByPostcode()->find('SW1A 1AA');

$getAddress = new GetAddressWrapper('api-key', 'admin-api-key', 'google-places-api-key', 'https://api.getAddress.io');
$response = $getAddress->findByPostcode()->findWithNumber('SW1A 1AA', 'Buckingham Palace');

$getAddress = new GetAddressWrapper('api-key', 'admin-api-key', 'google-places-api-key', 'https://api.getAddress.io');
$response = $getAddress->distance()->between('SW1A 1AA', 'SL4 1QF');

$getAddress = new GetAddressWrapper('api-key', 'admin-api-key', 'google-places-api-key', 'https://api.getAddress.io');
$response = $getAddress->autoCompletePostcode()->complete('SW1A');

$getAddress = new GetAddressWrapper('api-key', 'admin-api-key', 'google-places-api-key', 'https://api.getAddress.io');
$response = $getAddress->>autoCompletePlaces()->complete('Buckingham');

$getAddress = new GetAddressWrapper('api-key', 'admin-api-key', 'google-places-api-key', 'https://api.getAddress.io');
$response = $getAddress->autoCompletePlaces()->findByGooglePlacesId('ChIJtV5bzSAFdkgRpwLZFPWrJgo');

$getAddress = new GetAddressWrapper('api-key', 'admin-api-key', 'google-places-api-key', 'https://api.getAddress.io');
$response = $getAddress->usage()->get();

$getAddress = new GetAddressWrapper('api-key', 'admin-api-key', 'google-places-api-key', 'https://api.getAddress.io');
$response = $getAddress->usage()->getByDate('18/02/2020', 'd/m/Y');

$getAddress = new GetAddressWrapper('api-key', 'admin-api-key', 'google-places-api-key', 'https://api.getAddress.io');
$response = $getAddress->usage()->getBetween('18/02/2020', '19/02/2020', 'd/m/Y');

$getAddress = new GetAddressWrapper('api-key', 'admin-api-key', 'google-places-api-key', 'https://api.getAddress.io');
$response = $getAddress->privateAddress()->add('SW1A 1AA', [
                                     'line1' => 'Ashleigh\'s Palace',
                                     'line2' => '',
                                     'line3' => '',
                                     'line4' => '',
                                     'locality' => '',
                                     'townOrCity' => 'London',
                                     'county' => '',
                                 ]);

$getAddress = new GetAddressWrapper('api-key', 'admin-api-key', 'google-places-api-key', 'https://api.getAddress.io');
$response = $getAddress->privateAddress()->delete('SW1A 1AA', '1');

$getAddress = new GetAddressWrapper('api-key', 'admin-api-key', 'google-places-api-key', 'https://api.getAddress.io');
$response = $getAddress->privateAddress()->get('SW1A 1AA', '1');

$getAddress = new GetAddressWrapper('api-key', 'admin-api-key', 'google-places-api-key', 'https://api.getAddress.io');
$response = $getAddress->privateAddress()->list('SW1A 1AA');