ConfigUpdateRequest.php
1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
namespace App\Http\Container\AdminSection\Requests\System;
use Hikoon\LaravelApi\Support\ApiRequest;
class ConfigUpdateRequest extends ApiRequest
{
/**
* @return array<string,mixed>
*/
public function rules(): array
{
return [
'name' => 'required|string|between:0,100',
'expand.type' => 'required|string',
'content' => 'max:1000',
'remark' => 'nullable|max:400',
'status' => 'required|in:0,1',
'weight' => 'required|digits_between:0,200|integer'
];
}
/**
* @return array<string,string>
*/
public function messages(): array
{
return [
'name.required' => '请输入名称',
'expand.type.required' => '请选择内容格式',
'content.required_unless' => '请输入内容',
'content.max' => '内容超出长度限制',
'remark.required' => '请输入备注',
'remark.max' => '备注超过长度限制',
'status.required' => '请选择状态',
'status.in' => '选择的状态值不在指定范围内',
'weight.required' => '请输入权重值',
'weight.integer' => '权重值应为整数值',
'weight.digits_between' => '权重值应在0~200之间'
];
}
}