denismitr / real-domain-validator
Validator of domain names that uses DNS to verify the existance of a domain
Installs: 22
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/denismitr/real-domain-validator
Requires (Dev)
- phpspec/phpspec: ~2.0
This package is auto-updated.
Last update: 2020-01-22 22:42:09 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.