ProjectRequest.php
1.5 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
52
53
54
55
56
57
58
59
60
<?php
namespace App\Http\Requests\Aside\Project;
use App\Rules\Mobile;
use Illuminate\Foundation\Http\FormRequest;
/**
* Class ProjectRequest
* @package App\Http\Requests\Aside\product
* @author zbj
* @date 2023/4/25
*/
class ProjectRequest 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()
{
return [
// 'id' => 'required',
// 'title' => 'max:100',
// 'company' => 'max:100',
// 'lead_name' => 'max:20',
// 'mobile' => [new Mobile()],
// 'qq' => 'max:20',
// 'cooperate_date' => 'date_format:Y-m-d',
// 'province' => 'max:20',
// 'city' => 'max:20',
];
}
public function messages()
{
return [
'id.required' => 'ID不能为空',
'title.max' => '项目名称不能超过100个字符',
'company.max' => '公司名不能超过100个字符',
'lead_name.max' => '联系人不能超过20个字符',
'qq.max' => 'QQ号不能超过20个字符',
'cooperate_date.date_format' => '合作时间格式不正确',
'province.max' => '省份不能超过20个字符',
'city.max' => '城市不能超过20个字符',
];
}
}