定制 myerscode/laravel-domain-validator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

myerscode/laravel-domain-validator

最新稳定版本:13.0.0

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

Latest Stable Version Total Downloads PHP Version Require License Tests codecov

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.

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-05-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固