From 44cc4f6c72a71c3132f5b746bd7553dca0cc0020 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Fri, 19 Aug 2022 17:03:18 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E5=88=B6=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beike/Admin/Http/Requests/PageRequest.php | 2 +- resources/lang/zh_cn/validation.php | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/beike/Admin/Http/Requests/PageRequest.php b/beike/Admin/Http/Requests/PageRequest.php index 45610f79..c35b8261 100644 --- a/beike/Admin/Http/Requests/PageRequest.php +++ b/beike/Admin/Http/Requests/PageRequest.php @@ -33,7 +33,7 @@ class PageRequest extends FormRequest public function rules(): array { $rules = [ - 'descriptions.*.title' => 'required|string', + 'descriptions.*.title' => 'required|string|min:3|max:32', 'descriptions.*.content' => 'required|string', 'descriptions.*.locale' => 'required|string', ]; diff --git a/resources/lang/zh_cn/validation.php b/resources/lang/zh_cn/validation.php index ba42c8d9..d8b2e76f 100644 --- a/resources/lang/zh_cn/validation.php +++ b/resources/lang/zh_cn/validation.php @@ -81,9 +81,9 @@ return [ 'array' => 'The :attribute must not have more than :value items.', ], 'max' => [ - 'numeric' => 'The :attribute must not be greater than :max.', + 'numeric' => ':attribute不能大于 :max', 'file' => 'The :attribute must not be greater than :max kilobytes.', - 'string' => 'The :attribute must not be greater than :max characters.', + 'string' => ':attribute长度不能超过 :max 个字符', 'array' => 'The :attribute must not have more than :max items.', ], 'mimes' => 'The :attribute must be a file of type: :values.', @@ -155,6 +155,8 @@ return [ | */ - 'attributes' => [], + 'attributes' => [ + 'descriptions.en.title' => '信息标题' + ], ];