hazaveh/verify-domain

Verify Domain Ownership with PHP

1.0.3 2023-10-03 16:49 UTC

This package is auto-updated.

Last update: 2024-05-05 17:36:03 UTC


README

68747470733a2f2f68617a617665682e6e65742f77702d636f6e74656e742f75706c6f6164732f7665726966792d646f6d61696e2e6a706567

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 ❤️🚀