oarkhipov/whois

Fetcher of WHOIS information.

0.2.0 2017-10-17 15:49 UTC

README

[IN DEVELOPMENT] This package provides functionality to fetch WHOIS information of a domain.

Installation

composer require oarkhipov/whois

Laravel

There is a service provider for Laravel.
Add this to your providers array in config/app.php:

Oarkhipov\Whois\Laravel\WhoisServiceProvider::class,

Usage

Firstly, create Fetcher class instance:

use Oarkhipov\Whois\Fetcher;

$fetcher = new Fetcher();

With Laravel you are able to typehint it like that:

use Oarkhipov\Whois\Fetcher;

class TestController extends Controller
{
    private $whoisFetcher;

    public function __construct(Fetcher $fetcher)
    {
      $this->whoisFetcher = $fetcher;
    }
}

or resolve from container by whois name like that:

$fetcher = $this->app->make('whois');

Now to retrieve WHOIS record:

$whois = $fetcher->fetch('http://facebook.com');

Check wiki for a list of supported WHOIS record fields and tested top-level domains.