限制长度

This commit is contained in:
Edward Yang 2022-08-19 17:03:18 +08:00
parent ac0f1ac48e
commit 44cc4f6c72
2 changed files with 6 additions and 4 deletions

View File

@ -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',
];

View File

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