laravelfy / validator-enhancement
Laravel's validator enhancement
v0.11
2020-04-01 04:00 UTC
Requires
- php: >5.6
- laravel/framework: 5.*
Requires (Dev)
- illuminate/container: 5.*
- illuminate/events: 5.*
- illuminate/http: 5.*
- illuminate/routing: 5.*
- illuminate/validation: 5.*
- phpunit/phpunit: ~5.0
README
一个能帮你从 VALIDATOR/ 寻参/ 默认赋值 的逻辑中省代码的包。
Install
- Install to your composer project
composer require laravelfy/validator-enhancement
- Add service provider into
config/app.php
'sproviders
config array by filling:
Laravelfy\Validator\ServiceProvider::class,
Usage
<?php ... public function someEndPoint() { list( $page, $page_size ) = request()->validate( [ 'page' => 'integer|default:1|min:1', 'page_size' => 'integer|default:10|min:1|max:99', ] ); ... }
License
MIT