|
|
@@ -7,6 +7,10 @@ class ArticleValidator extends BaseValidator
|
|
|
'id' => 'required',
|
|
|
'realname' => 'required|string|min:1|max:20',
|
|
|
'phone' => 'required|string|min:2|max:20',
|
|
|
+ 'title' => 'required|string|min:2|max:50',
|
|
|
+ 'author' => 'required|string|min:2|max:20',
|
|
|
+ 'thumb' => 'required|string|min:2|max:250',
|
|
|
+ 'content' => 'required|string|min:2|max:500',
|
|
|
];
|
|
|
|
|
|
// 当前模型所有错误提示信息
|
|
|
@@ -24,12 +28,17 @@ class ArticleValidator extends BaseValidator
|
|
|
'id' => 'ID',
|
|
|
'realname' => '姓名',
|
|
|
'phone' => '联系电话',
|
|
|
+ 'author' => '作者',
|
|
|
+ 'thumb' => '封面图片',
|
|
|
+ 'title' => '标题',
|
|
|
+ 'content' => '内容',
|
|
|
];
|
|
|
|
|
|
// 当前模型所有验证场景
|
|
|
public static $scenes = [
|
|
|
'info'=> ['id'],
|
|
|
'books'=> ['id','realname','phone'],
|
|
|
+ 'send'=> ['title','author','content','thumb'],
|
|
|
];
|
|
|
|
|
|
/**
|