dave-arg/zod-php
最新稳定版本:v1.0.2
Composer 安装命令:
composer require dave-arg/zod-php
包简介
README 文档
README
A Zod-like implementation in PHP, inspired by Laravel's code standards.
Installation:
composer require dave-arg/zod-php
Usage:
The usage is pretty simple & straightforward, and is very similar to the original Zod library:
use DaveARG\Zod\Zod as Z; // Create the schema. $schema = Z::object([ 'name' => Z::string()->min(3)->max(15), 'age' => Z::number()->min(0), 'address' => Z::object([ 'city' => Z::string(), 'street' => Z::string(), ]), ]); // Validate the data. $parsed = $schema->parse([ 'name' => 'John Doe', 'age' => 20, 'address' => [ 'city' => 'New York', 'street' => 'Wall Street', ], ]);
统计信息
- 总下载量: 45
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2024-10-15