PHPackages                             houzhonghua/verify - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. houzhonghua/verify

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

houzhonghua/verify
==================

身份证号码验证、短信验证

06PHP

Since Apr 6Pushed 4y ago1 watchersCompare

[ Source](https://github.com/h5520/Verify)[ Packagist](https://packagist.org/packages/houzhonghua/verify)[ RSS](/packages/houzhonghua-verify/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

使用方式
====

[](#使用方式)

```
composer require houzhonghua/verify dev-main
```

身份证验证
=====

[](#身份证验证)

引入
--

[](#引入)

```
use houzhonghua\verify\Verify;
```

调用验证身份证号码格式方法
-------------

[](#调用验证身份证号码格式方法)

```
$res = Verify::ID("513721199412194010");
if($res){
    return '验证通过';
}
```

短信验证
====

[](#短信验证)

手册地址：

引入
--

[](#引入-1)

```
use houzhonghua\verify\SmsVerify;
```

```
// 生成验证码并缓存
$code = (new SmsVerify())->mobile('18888888888')->create();

// 生成登录（login）场景的验证码并缓存
$code = (new SmsVerify())->scene('login')->create();

// 手动传入号码和验证码
$smsVerify->mobile('18888888888')->code('123456')->check();

// 验证短信验证码
$smsVerify = new SmsVerify();
if(! $smsVerify->check()){
    //验证失败，获取失败信息
    $msg = $smsVerify->getErrorMsg();
}

// 验证登录（login）场景短信验证码
$smsVerify = new SmsVerify();
if(! $smsVerify->scene('login')->check()){
    //验证失败，获取失败信息
    $msg = $smsVerify->getErrorMsg();
}
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4a58b7d8823ea6412587a0ac2c6dc9d102ca4b72fcd87acceb55fa9b3a0f0261?d=identicon)[h5520](/maintainers/h5520)

---

Top Contributors

[![h5520](https://avatars.githubusercontent.com/u/57217010?v=4)](https://github.com/h5520 "h5520 (7 commits)")

### Embed Badge

![Health badge](/badges/houzhonghua-verify/health.svg)

```
[![Health](https://phpackages.com/badges/houzhonghua-verify/health.svg)](https://phpackages.com/packages/houzhonghua-verify)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[nette/forms

📝 Nette Forms: generating, validating and processing secure forms in PHP. Handy API, fully customizable, server &amp; client side validation and mature design.

54013.2M446](/packages/nette-forms)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
