mirror of
https://github.com/v2board/v2board.git
synced 2024-11-14 07:29:13 +08:00
update tutorial
This commit is contained in:
parent
0a2c626f89
commit
a56faa7e8e
@ -6,6 +6,12 @@ use Illuminate\Foundation\Http\FormRequest;
|
|||||||
|
|
||||||
class TutorialSave extends FormRequest
|
class TutorialSave extends FormRequest
|
||||||
{
|
{
|
||||||
|
CONST RULES = [
|
||||||
|
'title' => 'required',
|
||||||
|
'category' => 'required|in:windows,macos,ios,android,linux,router',
|
||||||
|
'description' => 'required',
|
||||||
|
'icon' => 'required'
|
||||||
|
];
|
||||||
/**
|
/**
|
||||||
* Get the validation rules that apply to the request.
|
* Get the validation rules that apply to the request.
|
||||||
*
|
*
|
||||||
@ -13,17 +19,15 @@ class TutorialSave extends FormRequest
|
|||||||
*/
|
*/
|
||||||
public function rules()
|
public function rules()
|
||||||
{
|
{
|
||||||
return [
|
return self::RULES;
|
||||||
'title' => 'required',
|
|
||||||
'description' => 'required',
|
|
||||||
'icon' => 'required'
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function messages()
|
public function messages()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'title.required' => '标题不能为空',
|
'title.required' => '标题不能为空',
|
||||||
|
'category.required' => '分类不能为空',
|
||||||
|
'category.in' => '分类格式不正确',
|
||||||
'description.required' => '描述不能为空',
|
'description.required' => '描述不能为空',
|
||||||
'icon.required' => '图标不能为空'
|
'icon.required' => '图标不能为空'
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user