PHPackages                             illuminatech/validation-composite - 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. illuminatech/validation-composite

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

illuminatech/validation-composite
=================================

Allows uniting several validation rules into a single one for easy re-usage

1.2.7(1mo ago)184485.5k—4.9%5BSD-3-ClausePHPCI passing

Since Jun 18Pushed 1mo ago3 watchersCompare

[ Source](https://github.com/illuminatech/validation-composite)[ Packagist](https://packagist.org/packages/illuminatech/validation-composite)[ GitHub Sponsors](https://github.com/klimov-paul)[ Patreon](https://www.patreon.com/klimov_paul)[ RSS](/packages/illuminatech-validation-composite/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (12)Used By (0)

 [ ![](https://avatars1.githubusercontent.com/u/47185924) ](https://github.com/illuminatech)

Laravel Composite Validation
============================

[](#laravel-composite-validation)

This extension allows uniting several Laravel validation rules into a single one for easy re-usage.

For license information check the [LICENSE](LICENSE.md)-file.

[![Latest Stable Version](https://camo.githubusercontent.com/6210f9f10ebe3799d4202ecdb7c229ed31caa38e6ca1d39d05999c2814a9c5ce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f696c6c756d696e61746563682f76616c69646174696f6e2d636f6d706f736974652e737667)](https://packagist.org/packages/illuminatech/validation-composite)[![Total Downloads](https://camo.githubusercontent.com/c8acaba228cf7b96e306b502e00d789300ef2f998109f0a95cd99a2489010d45/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f696c6c756d696e61746563682f76616c69646174696f6e2d636f6d706f736974652e737667)](https://packagist.org/packages/illuminatech/validation-composite)[![Build Status](https://github.com/illuminatech/validation-composite/workflows/build/badge.svg)](https://github.com/illuminatech/validation-composite/actions)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist illuminatech/validation-composite

```

or add

```
"illuminatech/validation-composite": "*"
```

to the require section of your composer.json.

Usage
-----

[](#usage)

The same sequence of the validation rules may repeat over the application many times. For example: you may have a set of restrictions related to the user's password, like it should be at least 8 symbols long, but shorter then 200 to fit the database field reserved for its storage. Your program may also allow user to upload an image to be his avatar, but in order to make it safe, you should validate uploaded file mime type and size. Thus validation for the user profile form may looks like following:

```
