PHP code example of c6digital / mapit-php
1. Go to this page and download the library: Download c6digital/mapit-php 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/ */
c6digital / mapit-php example snippets
use C6Digital\MapIt\MapIt;
$mapIt = new MapIt(
key: 'your-mapit-key-here', // Your MapIt API key / token.
url: 'https://mapit.mysociety.org' // An optional MapIt URL.
);
use C6Digital\MapIt\MapIt;
class MyController
{
public function __invoke(MapIt $mapIt)
{
// ...
}
}
$mapIt->postcode('SW1P 3BD');
$mapIt->throw()->postcode(...);
bash
composer