root 5 years ago
parent
commit
6ccd8e583f
1 changed files with 4 additions and 1 deletions
  1. 4 1
      app/Http/Controllers/Admin/NoticeController.php

+ 4 - 1
app/Http/Controllers/Admin/NoticeController.php

@@ -21,8 +21,11 @@ class NoticeController extends Controller
             'title',
             'content'
         ]);
+        if (!Notice::create($data)) {
+            abort(500, '保存失败');
+        }
         return response([
-            'data' => Notice::create($data)
+            'data' => true
         ]);
     }
 }