This commit is contained in:
root
2019-12-12 16:29:35 +08:00
parent 91c4bedbad
commit 21050afa60
2 changed files with 8 additions and 4 deletions

View File

@ -19,7 +19,8 @@ class NoticeController extends Controller
public function save (NoticeSave $request) {
$data = $request->only([
'title',
'content'
'content',
'img_url'
]);
if (!Notice::create($data)) {
abort(500, '保存失败');
@ -32,7 +33,8 @@ class NoticeController extends Controller
public function update (NoticeSave $request) {
$data = $request->only([
'title',
'content'
'content',
'img_url'
]);
if (!Notice::where('id', $request->input('id'))->update($data)) {
abort(500, '保存失败');