承接 logadapp/validator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

logadapp/validator

最新稳定版本:v0.0.1

Composer 安装命令:

composer require logadapp/validator

包简介

Request Validation library

README 文档

README


LogadApp\Validator

Report Bug · Request Feature

About The Project

Features

  • Simple to use
  • Supports underscores and camelcase (file_size or fileSize)
  • Easy to create your own rules
  • File validation
  • Min\Max length validation
  • Email validation
  • File size validation
  • Conditional requirements
  • Similar to Laravel's validation feature
  • Inspired by Rakit\Validation

Installation

How to install.

  1. Using composer
    composer require logadapp/validator
  2. Include the generated autoload in your file, See index.php for example

Usage

<?php

use LogadApp\Validator\Validation;

require('vendor/autoload.php');

$validator = new Validation;
$rules = [
    'test' => 'required|numeric|max:10|min:5',
    'text' => 'required|maxLength:5|minLength:3',
    'email' => 'required|email',
    'type' => 'required|in:user,admin',
    'name' => 'requiredIf:type,user,admin',
    'profilePic' => 'file|requiredIf:type,user,admin|fileSize:10KB|fileType:jpg,png,jpeg',
];
$validator->make($_POST, $_FILES, $rules);

$validator->validate();

OR Validate directly

$validator->validate($_POST, $_FILES, $rules);

Built With

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch
  3. Commit your Changes
  4. Push to the Branch
  5. Open a Pull Request

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-09