PHPackages                             gerob/l4-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. gerob/l4-validation

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

gerob/l4-validation
===================

0.6(12y ago)038PHPPHP &gt;=5.3.0

Since Mar 10Pushed 11y ago1 watchersCompare

[ Source](https://github.com/gerob/laravel-extended-validator)[ Packagist](https://packagist.org/packages/gerob/l4-validation)[ RSS](/packages/gerob-l4-validation/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (4)Versions (3)Used By (0)

Laravel Extended Validator
==========================

[](#laravel-extended-validator)

Introduction
============

[](#introduction)

This package was created for several purposes:

1. To ease the creation of validation services - we all know validaton should be moved out of the controller
2. Provide an easy way to provide context for validations - such as providing a modified set of validation rules for edit vs. create
3. Provide an easy way to group validations - that is, calling one 'passes()' method to validate multiple models
4. Fork to allow updating framework

Installation
============

[](#installation)

Install this package through Composer. Add the following to your composer.json file:

```
"require": {
    "crhayes/validation": "dev-master"
}
```

Next, run composer install

Finally, add the service provider and the facade to app/config/app.php.

```
'providers' => array(
    // ...

    'Crhayes\Validation\ValidationServiceProvider'
)

'aliases' => array(
    // ...

    'GroupedValidator' => 'Crhayes\Validation\Facade'
)
```

Validation as a Service
=======================

[](#validation-as-a-service)

Most Basic Validator
--------------------

[](#most-basic-validator)

To create a validation service simply extend the base abstract ContextualValidation class and provide an array of rules and messages (messages will override Laravel's default validation messages).

```
