PHP code example of myerscode / laravel-domain-validator

1. Go to this page and download the library: Download myerscode/laravel-domain-validator 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/ */

    

myerscode / laravel-domain-validator example snippets


artisan domain-validator:cache

artisan domain-validator:cache

artisan domain-validator:refresh

// routes/console.php

Schedule::call('domain-validator:refresh')->daily();

// alternatively initialize a new command class

Schedule::call(new \Myerscode\Laravel\DomainValidator\Commands\RefreshCommand)->daily();

hasICANNSuffix('myerscode.com') // true

hasICANNSuffix('cloudfront.net') // false

hasKnownSuffix('myerscode.co') // true

hasKnownSuffix('myerscode.corgi') // false

hasPrivateSuffix('myerscode.cloudfront.net') // true

hasPrivateSuffix('cloudfront.net') // false

isDomain('myerscode.com') // true

isDomain('.com') // false

isTld('.com') // true

isTld('.corgi') // false