mirror of
https://github.com/v2board/v2board.git
synced 2025-06-14 13:47:49 +08:00
feature: knowledge base & surplus switch
This commit is contained in:
@ -42,6 +42,7 @@ class ConfigSave extends FormRequest
|
||||
'plan_change_enable' => 'in:0,1',
|
||||
'reset_traffic_method' => 'in:0,1',
|
||||
'renew_reset_traffic_enable' => 'in:0,1',
|
||||
'surplus_enable' => 'in:0,1',
|
||||
// server
|
||||
'server_token' => 'nullable|min:16',
|
||||
'server_license' => 'nullable',
|
||||
|
29
app/Http/Requests/Admin/KnowledgeCategorySave.php
Normal file
29
app/Http/Requests/Admin/KnowledgeCategorySave.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Admin;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class KnowledgeCategorySave extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'name' => 'required',
|
||||
'language' => 'required'
|
||||
];
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'name.required' => '分类名称不能为空',
|
||||
'language.required' => '分类语言不能为空'
|
||||
];
|
||||
}
|
||||
}
|
28
app/Http/Requests/Admin/KnowledgeCategorySort.php
Normal file
28
app/Http/Requests/Admin/KnowledgeCategorySort.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Admin;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class KnowledgeCategorySort extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'knowledge_category_ids' => 'required|array'
|
||||
];
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'knowledge_category_ids.required' => '分类不能为空',
|
||||
'knowledge_category_ids.array' => '分类格式有误'
|
||||
];
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ namespace App\Http\Requests\Admin;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class TutorialSave extends FormRequest
|
||||
class KnowledgeSave extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
@ -14,10 +14,10 @@ class TutorialSave extends FormRequest
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'category' => 'required',
|
||||
'language' => 'required',
|
||||
'title' => 'required',
|
||||
// 1:windows 2:macos 3:ios 4:android 5:linux 6:router
|
||||
'category_id' => 'required|in:1,2,3,4,5,6',
|
||||
'steps' => 'required'
|
||||
'body' => 'required'
|
||||
];
|
||||
}
|
||||
|
||||
@ -25,9 +25,9 @@ class TutorialSave extends FormRequest
|
||||
{
|
||||
return [
|
||||
'title.required' => '标题不能为空',
|
||||
'category_id.required' => '分类不能为空',
|
||||
'category_id.in' => '分类格式不正确',
|
||||
'steps.required' => '教程步骤不能为空'
|
||||
'category.required' => '分类不能为空',
|
||||
'body.required' => '内容不能为空',
|
||||
'language.required' => '语言不能为空'
|
||||
];
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ namespace App\Http\Requests\Admin;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class TutorialSort extends FormRequest
|
||||
class KnowledgeSort extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
@ -14,15 +14,15 @@ class TutorialSort extends FormRequest
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'tutorial_ids' => 'required|array'
|
||||
'knowledge_ids' => 'required|array'
|
||||
];
|
||||
}
|
||||
|
||||
public function messages()
|
||||
{
|
||||
return [
|
||||
'tutorial_ids.required' => '教程ID不能为空',
|
||||
'tutorial_ids.array' => '教程ID格式有误'
|
||||
'knowledge_ids.required' => '知识ID不能为空',
|
||||
'knowledge_ids.array' => '知识ID格式有误'
|
||||
];
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user