Skip to content

About

[READ-ONLY] Validation component for Marko Framework. Issues and PRs at https://github.com/marko-php/marko

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

marko/validation

Input validation with built-in rules, string-based rule parsing, and custom rule support — validate data before it reaches your domain.

Installation

composer require marko/validation

Quick Example

use Marko\Validation\Contracts\ValidatorInterface;

$errors = $this->validator->validate([...$request->input(), ...$request->files()], [
    'name' => 'required|string|max:100',
    'email' => 'required|email',
    'age' => 'nullable|integer|min:18',
    'avatar' => 'nullable|file|image|max_size:2048',
    'photos.*' => 'image|max_size:2048', // every file of a photos[] upload
]);

if ($errors->isNotEmpty()) {
    // handle errors
}

Documentation

Full usage, API reference, and examples: marko/validation

About

[READ-ONLY] Validation component for Marko Framework. Issues and PRs at https://github.com/marko-php/marko

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages