PHP code example of theprivateer / domainr

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

    

theprivateer / domainr example snippets


// autoload
new \Privateer\Domainr\Domainr('YOUR_MASHAPE_API_KEY');


$client->search($query, $location = null, $registrar = null, $defaults = null);

$client->search('acme.coffee');

$client->register($domain, $registrar = null);

$client->register('acme.coffee');

// https://domains.google.com/registrar?s=acme.coffee&utm_campaign=domainr.com&utm_content=&af=domainr.com

$client->status($domain);

$status = $client->status('acme.coffee');

$status = $client->status('acme.coffee');

$status->get('domain');
// acme.coffee

$status->get('zone');
// coffee

$status->get('status');
// undelegated inactive

$status->get('summary');
// inactive

$status->get('description');
// Available for new registration.

$status->get('available');
// true

Status::description($summary);

\Privateer\Domainr\Status::description('inactive'); 
// Available for new registration.

\Privateer\Domainr\Status::available('inactive'); 
// true