Download the PHP package kohkimakimoto/laravel-validator-extension without Composer
On this page you can find all versions of the php package kohkimakimoto/laravel-validator-extension. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kohkimakimoto/laravel-validator-extension
More information about kohkimakimoto/laravel-validator-extension
Files in kohkimakimoto/laravel-validator-extension
Package laravel-validator-extension
Short Description An extension for Laravel4 validator.
License MIT
Informations about the package laravel-validator-extension
Laravel Validator Extension
An extension for Laravel4 validator.
- Support to define validation rules in a specific class.
- Provide another syntax to define validation rules.
- Filter input values before and after validation.
Look at usage to get more detail.
Installation
Add dependency in composer.json
Run composer upadte
command.
Add ValidatorExtensionServiceProvider
provider to providers
configuration in app/config/app.php
.
Add BaseValidator
alias to aliases
configuration in app/config/app.php
.
Add a path to laravel class loader in app/start/global.php
.
And add a path at autoload
section in composer.json
.
Usage
- Define validation rules
- Filters
- Custom validation rules
- Custom methods
Define validation rules
You can define validation rules in a validator class. If you added a path to autoload and class loader configuration at the installation steps, you can define the validator class in the app/validators
directory.
You can use $this->rule
method to add a validation rule. The third argument is optional to customize a error message.
The validator class is used as the below.
Filters
You can filter input values before and after validation.
Custom validation rules
You can define custom validation rules in the class.
Custom methods
The validator can be used as a value object. So you can append some custom methods to manipulate data stored in it.
LICENSE
The MIT License
Author
Kohki Makimoto [email protected]
All versions of laravel-validator-extension with dependencies
illuminate/support Version 4.*
illuminate/validation Version 4.*
illuminate/translation Version 4.*