This commit is contained in:
root 2019-12-12 14:34:28 +08:00
parent 6ccd8e583f
commit 055f5f8f7d
2 changed files with 14 additions and 0 deletions

View File

@ -28,4 +28,17 @@ class NoticeController extends Controller
'data' => true
]);
}
public function update (NoticeSave $request) {
$data = $request->only([
'title',
'content'
]);
if (!Notice::where('id', $request->input('id'))->update($data)) {
abort(500, '保存失败');
}
return response([
'data' => true
]);
}
}

View File

@ -47,6 +47,7 @@ Route::prefix('v1')
// Notice
Route::get ('notice', 'Admin\\NoticeController@index');
Route::post('notice/save', 'Admin\\NoticeController@save');
Route::post('notice/update', 'Admin\\NoticeController@update');
});
// User
Route::prefix('user')