astrotomic/laravel-dns
Composer 安装命令:
composer require astrotomic/laravel-dns
包简介
README 文档
README
Installation
composer require astrotomic/laravel-dns
Usage
use Astrotomic\Dns\Facades\Dns; /** @var \Illuminate\Support\Collection $records */ $records = Dns::records('astrotomic.info', DNS_A);
use Astrotomic\Dns\Rules\DnsRecordExists; use Spatie\Dns\Records\A; use Spatie\Dns\Records\TXT; return [ 'url' => [ 'required', 'string', 'url', // verify that domain of entered url // has any A, AAAA or CNAME record // and a TXT record with the users token DnsRecordExists::make() ->expect(DNS_A|DNS_AAAA|DNS_CNAME) ->expect(DNS_TXT, fn(TXT $record): bool => $record->txt() === 'token='.$this->user()->public_token), ], 'email' => [ 'required', 'string', 'email', // verify that domain of entered email // has any MX record // and SPF setup DnsRecordExists::make() ->expect(DNS_MX) ->expect(DNS_TXT, fn(TXT $record): bool => str_starts_with($record->txt(), 'v=spf1 ')), ], 'domain' => [ 'required', 'string', // verify that entered domain // has an A record // pointing to our IP-address DnsRecordExists::make() ->expect(DNS_A, fn(A $record): bool => $record->ip() === '127.0.0.1'), ], 'something' => [ 'required', 'string', // verify that value is something with DNS DnsRecordExists::make(), ], ];
use Astrotomic\Dns\Domain; protected $casts = [ 'domain' => Domain::class, ];
use Astrotomic\Dns\Domain; /** @var \Astrotomic\Dns\Domain $domain */ $domain = Domain::make('dns@astrotomic.info'); /** @var string|null $domain */ $domain = Domain::parse('dns@astrotomic.info');
astrotomic/laravel-dns 适用场景与选型建议
astrotomic/laravel-dns 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.9k 次下载、GitHub Stars 达 31, 最近一次更新时间为 2021 年 06 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「dns」 「laravel」 「astrotomic」 「laravel-dns」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 astrotomic/laravel-dns 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 astrotomic/laravel-dns 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 astrotomic/laravel-dns 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel bindings and facade to generate imgix URLs and support for multiple sources.
This package provides Laravel bindings and a Eloquent/Model trait for pragmarx/recovery package.
A fluent URL generator for images.weserv.nl
This package aims to provide the most common and flexible CMS features to your Laravel project.
An advanced PHP library for email validation with DNS checks and typo suggestions.
A fluent URL generator for images.weserv.nl with Laravel bindings.
统计信息
- 总下载量: 7.9k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 31
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-06-01