PHPackages                             harryosmar/plugin-validation - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. harryosmar/plugin-validation

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

harryosmar/plugin-validation
============================

PHP Composer Plugin for Validation

v2.2.3(8y ago)013[1 issues](https://github.com/harryosmar/plugin-validation/issues)PHPPHP &gt;=7.0

Since Jul 6Pushed 8y ago2 watchersCompare

[ Source](https://github.com/harryosmar/plugin-validation)[ Packagist](https://packagist.org/packages/harryosmar/plugin-validation)[ Docs](https://github.com/harryosmar/plugin-validation)[ RSS](/packages/harryosmar-plugin-validation/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (5)Versions (15)Used By (0)

Validation
==========

[](#validation)

Composer plugin for validation purpose, contains set of validation rules.

[![Latest Version](https://camo.githubusercontent.com/e97acb8fcca1e7752db8308e0f041878d9392e6159e4c2b798178d46ee7b6c66/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f68617272796f736d61722f706c7567696e2d76616c69646174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/harryosmar/plugin-validation/releases)[![Build Status](https://camo.githubusercontent.com/bbc99d7100aaa22a76f7b4b69d5238d66a64662e2ad4cc2d0553a415ab011e25/68747470733a2f2f7472617669732d63692e6f72672f68617272796f736d61722f706c7567696e2d76616c69646174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/harryosmar/plugin-validation)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0c71dcf2020d920a014e9ff95f485bdec00d1c499e704933b81f1c516cd721f9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68617272796f736d61722f706c7567696e2d76616c69646174696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/harryosmar/plugin-validation/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/e391e236e977c82491edad892374fa5e7fdb6efcf0bf9fec06dfa13008eebd4e/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68617272796f736d61722f706c7567696e2d76616c69646174696f6e2f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/harryosmar/plugin-validation/?branch=master)

Features
--------

[](#features)

- Multi Language, available `en`, `id`, or use your own [custom translation](#custom-translation)
- Validation for multi `fields` and a [`field`](https://github.com/harryosmar/plugin-validation#field) can have multi [`rules`](https://github.com/harryosmar/plugin-validation#available-rules)

```
validation > fields > rules

```

[![validation structure](https://github.com/harryosmar/plugin-validation/raw/master/resources/images/validation-structure.jpeg)](https://github.com/harryosmar/plugin-validation/blob/master/resources/images/validation-structure.jpeg)

Installation
------------

[](#installation)

Add this composer.json file

```
{
    "require": {
        "harryosmar/plugin-validation": "^2.2"
    }
}
```

Then running

```
$ composer install
```

Or type

```
composer require harryosmar/plugin-validation

```

in `composer.json` root directory

How To Use
----------

[](#how-to-use)

- [1. initialize](#1-initialize)
- [2. add `fields` to `$validation` object](#2-add-fields-to-validation-object)
- [3. call the `$validation` `run` method](#3-call-the-validation-run-method)
- [4, get the errors message if `$status` is `false`](#4-get-the-errors-message-if-status-is-false)
- [validation option with `break` validation chain](#validation-with-option-break-validation-chain)

###### 1. initialize

[](#1-initialize)

```
