hazaveh/verify-domain

Verify Domain Ownership with PHP

1.0.4 2024-06-14 10:05 UTC

This package is auto-updated.

Last update: 2024-11-14 11:05:11 UTC


README

VERIFY DOMAIN

PHP Verify Domain lets you verify the ownership of a domain by validating uploaded File Content, Meta Tags and TXT DNS records. You might have seen similar behaviour when verifying your domain in services like "Google Search Console" and ...

You can learn more about Verify Domain package in this blog post.

This library is compatible with php > 5 and has almost zero runtime dependency.

Installation

Simply run via composer:

composer require hazaveh/verify-domain

Usage

Simply instantiate the VerifyDomain Class or inject it using your DI container.

use Hazaveh\VerifyDomain\VerifyDomain;  
    
$verify = new VerifyDomain();  

/**
* Verifies if a TXT record with the value of "php-is-awesome" exists.
 */
$byDNS = $verify->verifyByDNS('hazaveh.net', 'php-is-awesome');

/**
* Verifies "https://hazaveh.net/verification.txt" with the content of "php-is-awesome" exists.
 */
$byFile = $verify->verifyByFile("hazaveh.net", 'verification.txt', "php-is-awesome");

/**
* Verifies '<meta name="verification" content="verification-code-123">' exists on hazaveh.net
 */
$byMeta = $verify->verifyByMeta("hazaveh.net", 'verification', "verification-code-123");

Contribution

Add something cool or fix a broken cup, run the tests and create a PR ❤️🚀