hyperf-plus/validate

hyperf-plus validate 支持request 和方法场景验证,兼容tp5写法 支持控制器注解验证、方法注解验证

v2.1.5 2021-01-18 11:30 UTC

This package is auto-updated.

Last update: 2022-05-24 12:58:27 UTC


README

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

安装

composer require hyperf-plus/validate

验证失败抛出 ValidateException

用法1

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

用法2 验证类、验证场景

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