NavRequest.php
1.0 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
44
45
46
47
48
49
50
51
<?php
namespace App\Http\Requests\Bside\Nav;
use Illuminate\Foundation\Http\FormRequest;
/**
* 导航 c端的 nav
* @author:dc
* @time 2023/5/11 15:20
* Class NavRequest
* @package App\Http\Requests\Bside\Nav
*/
class NavRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
$rule = [
'pid' => ['required','integer'],
'name' => ['required','max:100'],
];
return $rule;
}
public function messages()
{
return [
'pid.required' => '上级选择错误',
'pid.gte' => '上级选择错误',
'pid.integer' => '上级选择错误',
'name.required' => '名称必须',
'name.max' => '名称不能超过100个字符',
];
}
}