PHPackages                             rewake/lumen-validation-v6 - 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. rewake/lumen-validation-v6

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

rewake/lumen-validation-v6
==========================

Enhanced validation for Lumen v6

17[2 PRs](https://github.com/rewake/lumen-validation-v6/pulls)PHP

Since Aug 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rewake/lumen-validation-v6)[ Packagist](https://packagist.org/packages/rewake/lumen-validation-v6)[ RSS](/packages/rewake-lumen-validation-v6/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (3)Used By (0)

Enhanced Lumen Validation
=========================

[](#enhanced-lumen-validation)

NOTE: This package is for Lumen v6. For Lumen v5 use

This library provides enhancements to the `illuminate/validation` package which will validate objects and classes instead of arrays "only". The default Lumen validator has been wrapped so that all existing validation functionality *should* be available, however this is not yet fully tested.

A `ValidationRuleInterface` is also provided so that validation rules may be classified for ease of use and code separation.

Registering the Validator
-------------------------

[](#registering-the-validator)

A Service Provider is included to make registering the Validation Service easy from `app.php` config.

```
$app->register(Rewake\Lumen\Providers\ValidationServiceProvider::class);

```

**NOTE:**This Service Provider will override the default `app('validator')` alias within lumen, and is currently not tested fully. If you would like to keep them separate (or *need* to keep them separate), you can create a new Provider to do so.

#### Example

[](#example)

```
public function register()
{
    // Register Validation Service
    $this->app->singleton(
        'validation_service',
        \Rewake\Lumen\Services\ValidationService::class
    );
}

```

Example Validation Class &amp; Usage
------------------------------------

[](#example-validation-class--usage)

#### Class

[](#class)

```
