myerscode/laravel-domain-validator
Composer 安装命令:
composer require myerscode/laravel-domain-validator
包简介
Validate Domains names in Laravel using PHP Domain Parser.
README 文档
README
A Laravel package for validating domain properties
Requirements
- PHP ^8.5
- Laravel ^13.0
Why is this useful?
It allows easy integration of the PHP Domain Parser PHP Domain Parser by Jeremy Kendall into a Laravel app, in order to validate values against known domain data.
Installation
The package can be installed via composer:
composer require myerscode/laravel-domain-validator
Usage
Fetch data sets
artisan domain-validator:fetch
Cache the fetched data sets
artisan domain-validator:cache
Do both together!
artisan domain-validator:refresh
Scheduling
It is recommended to schedule the refresh command, in order to remove the need of running the domain-validator:refresh command
every time you need to update your cache.
// routes/console.php Schedule::call('domain-validator:refresh')->daily(); // alternatively initialize a new command class Schedule::call(new \Myerscode\Laravel\DomainValidator\Commands\RefreshCommand)->daily();
Checks
Note: For developer experience, all strings passed will be sanitized to remove trailing slashes / and http(s)://.
Has ICANN Suffix
Tells whether the effective TLD has a matching rule in a Public Suffix List ICANN Section.
hasICANNSuffix('myerscode.com') // true hasICANNSuffix('cloudfront.net') // false
Has Known Suffix
Tells whether the effective TLD has a matching rule in a Public Suffix List.
hasKnownSuffix('myerscode.co') // true hasKnownSuffix('myerscode.corgi') // false
Has Private Suffix
Tells whether the effective TLD has a matching rule in a Public Suffix List Private Section.
hasPrivateSuffix('myerscode.cloudfront.net') // true hasPrivateSuffix('cloudfront.net') // false
Is Domain
Is the value parseable as to a valid domain
isDomain('myerscode.com') // true isDomain('.com') // false
Is TLD
Is the value a valid Top Level Domain
isTld('.com') // true isTld('.corgi') // false
Issues
Bug reports and feature requests can be submitted on the Github Issue Tracker.
Contributing
We are very happy to receive pull requests to add functionality or fixes. Please read the Myerscode contributing guide for information.
License
The MIT License (MIT). Please see License File for more information.
myerscode/laravel-domain-validator 适用场景与选型建议
myerscode/laravel-domain-validator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14 次下载、GitHub Stars 达 2, 最近一次更新时间为 2024 年 05 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「domain parser」 「iana」 「icann」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 myerscode/laravel-domain-validator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 myerscode/laravel-domain-validator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 myerscode/laravel-domain-validator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easy to use SDK with grabber for multiple platforms at once like YouTube, Dailymotion, Facebook and more.
An MT940 bank statement parser for PHP
Build a domain-oriented application on Laravel Framework
Command bus implementation: Commands and domain events
Laravel integration for the jsonapi.org parser
A module manager for Zend Framework which can be used to create configs per domain.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-02