denismitr/real-domain-validator

Validator of domain names that uses DNS to verify the existance of a domain

v1.0.0 2016-07-08 18:12 UTC

README

By Denis Mitrofanov, 2016

Installation

composer require denismitr/real-domain-validator

Usage

If you are using Laravel, than you can extend the Laravel validator in AppServiceProvider@boot like so:

Validator::extend('real_domain', 'Denismitr\Validators\RealDomainValidator@validationCallback');

Otherwise just install, instantiate and use isValidDomain method like that:

$validator = new RealDomainValidator();
$result = $validator->isValidDomain("google.com");

Http or https prefixes not a problem - will work as well.