dave-arg/zod-php 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-10-15