This commit is contained in:
root 2020-01-02 21:49:04 +08:00
parent 96d3a27a5b
commit 34fa75b4cc
3 changed files with 10 additions and 1 deletions

View File

@ -18,7 +18,9 @@ class TutorialController extends Controller
public function save (TutorialSave $request) {
$params = $request->only([
'title',
'description'
'description',
'steps',
'icon'
]);
if (!$request->input('id')) {

View File

@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\User;
use App\Models\Tutorial;
class TutorialController extends Controller
{
@ -32,4 +33,8 @@ class TutorialController extends Controller
]
]);
}
public function fetch (Request $request) {
$tutorial = Tutorial::select(['title', 'description', 'icon'])->get();
}
}

View File

@ -16,6 +16,7 @@ class TutorialSave extends FormRequest
return [
'title' => 'required',
'description' => 'required',
'icon' => 'required'
];
}
@ -24,6 +25,7 @@ class TutorialSave extends FormRequest
return [
'title.required' => '标题不能为空',
'description.required' => '描述不能为空',
'icon.required' => '图标不能为空'
];
}
}