From 72805abde719d674a318ad219b9d58284b3925a3 Mon Sep 17 00:00:00 2001 From: Leonis Date: Sun, 29 Sep 2019 18:18:19 +0800 Subject: [PATCH 1/2] Format --- src/validation/README.md | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/src/validation/README.md b/src/validation/README.md index 0d17f8e68..42ed2b9ad 100644 --- a/src/validation/README.md +++ b/src/validation/README.md @@ -9,7 +9,6 @@ ``` composer require hyperf/validation - ``` ## Config @@ -18,19 +17,17 @@ composer require hyperf/validation ### publish config ``` php bin/hyperf.php vendor:publish hyperf/validation - ``` ### config path ``` your/config/path/autoload/translation.php - ``` ### config content -``` +```php '', 'lang' => BASE_PATH . '/resources/lang', ]; - ``` ### exception handler -``` +```php input('foo'); @@ -149,6 +141,4 @@ class IndexController extends Controller } } } - - -``` \ No newline at end of file +``` From d8a820342650691994e584ed10e11c0845f6e130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=9C=9D=E6=99=96?= Date: Sun, 29 Sep 2019 18:40:30 +0800 Subject: [PATCH 2/2] Update README.md --- src/validation/README.md | 58 ++++++++-------------------------------- 1 file changed, 11 insertions(+), 47 deletions(-) diff --git a/src/validation/README.md b/src/validation/README.md index 42ed2b9ad..22d64a7dd 100644 --- a/src/validation/README.md +++ b/src/validation/README.md @@ -1,11 +1,10 @@ # Hyperf Validation - ## About [hyperf/validation](https://github.com/hyperf-cloud/validation) 组件衍生于 `Laravel Validation` 组件的,我们对它进行了一些改造,大部分功能保持了相同。在这里感谢一下 Laravel 开发组,实现了如此强大好用的 Validation 组件。 -## Install +## Installation ``` composer require hyperf/validation @@ -13,34 +12,22 @@ composer require hyperf/validation ## Config +### Publish config file -### publish config ``` -php bin/hyperf.php vendor:publish hyperf/validation +php bin/hyperf.php vendor:publish hyperf/validation ``` -### config path +### Configuration path ``` your/config/path/autoload/translation.php ``` -### config content +### Configuration ```php 'en', 'fallback_locale' => '', @@ -48,22 +35,10 @@ return [ ]; ``` -### exception handler +### Exception handler ```php [ 'http' => [ @@ -73,22 +48,10 @@ return [ ]; ``` -### validation middleware +### Validation middleware ```php [ \Hyperf\Validation\Middleware\ValidationMiddleware::class, @@ -100,15 +63,16 @@ return [ ## Usage -### gen request +### Generate form request +Command: ``` php bin/hyperf.php gen:request FooRequest ``` - +Usage: ```php -class IndexController extends Controller +class IndexController { public function foo(FooRequest $request) {