sysborg/check-my-domain
Composer 安装命令:
composer require sysborg/check-my-domain
包简介
A lightweight Laravel package for domain ownership verification using DNS TXT records.
README 文档
README
A lightweight and developer-friendly Laravel package for verifying domain ownership using DNS TXT records.
🚀 Features
- 🔐 Verifies domain ownership via DNS TXT records.
- ⚙️ Easily configurable and customizable.
- 🔗 Prefix-based hashing for safe and unique TXT records.
- ⚡ Simple to integrate into any Laravel project.
📦 Installation
composer require sysborg/check-my-domain
🛠️ Configuration
Optionally publish the configuration file:
php artisan vendor:publish --tag=check-my-domain-config
This will publish the file to:
config/checkMyDomain.php
Example config (config/checkMyDomain.php)
return [ 'prefix' => 'sbv', 'settings' => [ 'use-domain' => true, ], ];
| Key | Description |
|---|---|
prefix |
Prefix used in the TXT record name/value (e.g., sbv=...) |
use-domain |
If true, includes the domain name in the generated hash |
🧠 Usage
Injecting the Service
use Facades\Sysborg\CheckMyDomain\Lib\Domain; $domainService = Domain::methodName(...parameters);
Generating a TXT Record
$record = Domain::generateTxtRecord('example.com', 'user-123'); // Output: sbv=4f8a3bd9eabf3c22bb9a5e2dd5c03f4c8ae6d2ef9f709137b20a2fd4e9d1
Validating Against DNS
$isVerified = Domain::compareTxtRecord('example.com', $record); if ($isVerified) { echo '✅ Domain verified successfully!'; } else { echo '❌ Domain verification failed.'; }
🧪 Testing
composer test
Or use PHPUnit directly if configured:
./vendor/bin/phpunit
📁 Directory Structure
src/
├── config/
│ └── checkMyDomain.php
├── Exceptions/
│ ├── InvalidDomainException.php
│ └── InvalidPrefixException.php
├── Lib/
│ └── Domain.php
├── Providers/
│ └── CheckMyDomainProvider.php
📚 How It Works
- The package generates a unique hash based on your prefix, user ID, domain, and timestamp.
- The user adds the TXT record to their DNS zone (e.g.
sbv=abcdef123456...). - You use
compareTxtRecord()to query the domain and validate if the correct TXT record is present.
This makes it easy to verify domain ownership for:
- User-generated domains
- SaaS onboarding
- API clients or webhook callbacks
🧩 Integration Ideas
- 🔗 Connect to onboarding flows (verify user domains).
- 🛡️ Add protection to webhook registration or integrations.
- ⚙️ Automate DNS verification with APIs like Cloudflare.
👥 Credits
Maintained by Sysborg Created by Anderson Arruda
📄 License
MIT License. See LICENSE file for details.
sysborg/check-my-domain 适用场景与选型建议
sysborg/check-my-domain 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 473 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 07 月 23 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 sysborg/check-my-domain 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 sysborg/check-my-domain 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 473
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 26
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-23