Skip to content

兼容tp验证器规则,支持多场景,swagger自动提取验证规则。

License

Notifications You must be signed in to change notification settings

hyperf-plus/validate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

validate

兼容tp验证器规则,支持多场景,swagger自动提取验证规则。

安装

composer require hyperf-plus/validate

验证失败抛出 ValidateException

用法1

@RequestValidation(rules={
    "username|用户名":"require|max:25",
    "password|密码":"require"
})

用法2 验证类、验证场景

@RequestValidation(validate=User::class,scene="login")

About

兼容tp验证器规则,支持多场景,swagger自动提取验证规则。

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages