PHP code example of mralston / mug

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

    

mralston / mug example snippets


// Determine whether a post code is ready to switch
Mug::addressPostcodeReady($this->postCode);

// Retrieve addresses matched by a post code
Mug::addressRecco($this->postCode);

// Retrieve details about a specific address
Mug::addressReccoDetails($address);

// $address attribute is an array which must contain
// mpancore and xoserveAddressCode elements.

// You may supply an entry from the collection
// returned by Mug::addressRecco()
Mug::addressReccoDetails(
    Mug::addressRecco($this->postCode)
        ->first()
);

bash
php artisan vendor:publish --tag=mug-config