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' => '信息标题' + ], ];