Micro Dream Form ValidateMicro Dream Form Validate
Home
Docs
Plugin
IDE Support
Source Code
  • 简体中文
  • English
Home
Docs
Plugin
IDE Support
Source Code
  • 简体中文
  • English

Micro Dream Form Validate

Enhanced form validate - Manage validate scene

Validate

Micro Dream Form ValidateSimple and elegant validation

A lightweight, flexible, high-performance PHP form validation library with scene-based management, keeping your validation logic clear and maintainable.

Get StartedSource Code
starsforksDownloads2.7M
v6.3.2
Explore more
Quick Demo
validator.php
1class UserValidate extends Validate
2{
3 protected $rule = [
4 'user' => 'required|email',
5 'pass' => 'required|string|between:6,16',
6 'name' => 'required|chs'
7 ];
8
9 protected $scene = [
10 'login' => ['user', 'pass'],
11 'register' => ['user', 'pass', 'name'],
12 ];
13}
14
15// Login Business
16$data = (new UserValidate())
17 ->scene('login')
18 ->check($userInput);
Output

Core Capabilities

Easily configure complex yet clear validation logic

It transitions from rules and scenarios to message feedback, handles data processing and type conversion, and remains simple, stable, and maintainable while being centered around real‑world business forms.

01

Rules Management

Conveniently manage, generate, and extract validation rules. Supports built-in rules, custom rules, and private rules to meet various validation scenarios.

40+ built-in validation rules covering common data types, format comparison, file uploads, and more. Supports rule parameter parsers for more flexible rule definitions.

02

Validation Scenes

Combine validation rules arbitrarily and generate appropriate validation rules dynamically. Different business scenarios use different field combinations — define once, reuse everywhere.

Supports scene-based validation management. Flexibly switch between login, registration, password change, and other scenarios, significantly reducing duplicate code.

03

Error Messages

Multiple error message definition methods, default rule messages, and support for variables to make your interactions clearer.

Supports custom error message templates, multi-language messages, field aliases, and other advanced features for user-friendly error prompts.

Quick Install

$ composer require itwmw/validateClick to copy

IDE Plugin

JetBrains MarketplaceValidate for PhpStormPlugin4.8Adds rule completion, type inference, inspections, and quick fixes for the itwmw/validate in PhpStorm.Completion and inspections759.2K downloadsView plugin

Apache 2.0 Licensed | Copyright 2013-Present MicroDreamTeam