PHP code example of galahad / laravel-addressing

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

    

galahad / laravel-addressing example snippets


$country = Addressing::country('US');
echo $country->getName(); // "United States"
echo $country->getCountryCode(); // "US"

$usa = Addressing::country('US');

echo $usa->administrativeArea('AL')->getName(); // "Alabama"
echo $usa->administrativeArea('AL')->getCode(); // "AL"

typeof $usa->administrativeAreas() // AdministrativeAreaCollection

$this->validate($request, [
    'country' => '' => '

// "country_field" is the form input that represents the country to validate against

$this->validate($request, [
    'state' => ' [
    'state' => '

$this->validate($request, [
    'postal_code' => '