[IN DEVELOPMENT] This package provides functionality to fetch WHOIS information of a domain.
composer require oarkhipov/whois
There is a service provider for Laravel.
Add this to your providers array in config/app.php
:
Oarkhipov\Whois\Laravel\WhoisServiceProvider::class,
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.