PHP code example of wubs / postcode-api

1. Go to this page and download the library: Download wubs/postcode-api 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/ */

    

wubs / postcode-api example snippets



Zip::address("1234AA", 11);


$api = $app->make('\Wubs\Zip\ZipApi')

 namespace App\Http\Controllers;

use Wubs\Zip\ZipApi;

class ZipController extends Controller
{
   private $api;
   
    public function __construct(ZipApi $api)
    {
        $this->api = $api;
        
    }
}


Wubs\Zip\ZipApi;

$zipApi = new ZipApi("API_KEY");
$address = $postcodeApi->address("1234AA", 11);
bash
php artisan vendor:publish