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

ActiveLibrary

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

Enhanced validation for Lumen

21.0k[1 issues](https://github.com/rewake/lumen-validation/issues)PHP

Since Nov 1Pushed 6y ago1 watchersCompare

[ Source](https://github.com/rewake/lumen-validation)[ Packagist](https://packagist.org/packages/rewake/lumen-validation)[ RSS](/packages/rewake-lumen-validation/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

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

[](#enhanced-lumen-validation)

NOTE: This package is for Lumen v5. For Lumen v6 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)

```
