mirror of
				https://github.com/v2board/v2board.git
				synced 2025-10-31 09:21:46 +08:00 
			
		
		
		
	update
This commit is contained in:
		| @@ -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, '保存失败'); | ||||
|   | ||||
| @@ -15,7 +15,8 @@ class NoticeSave extends FormRequest | ||||
|     { | ||||
|         return [ | ||||
|             'title' => 'required', | ||||
|             'content' => 'required' | ||||
|             'content' => 'required', | ||||
|             'img_url' => 'url' | ||||
|         ]; | ||||
|     } | ||||
|      | ||||
| @@ -23,7 +24,8 @@ class NoticeSave extends FormRequest | ||||
|     { | ||||
|         return [ | ||||
|             'title.required' => '标题不能为空', | ||||
|             'content.required' => '内容不能为空' | ||||
|             'content.required' => '内容不能为空', | ||||
|             'img_url.url' => '图片URL格式不正确' | ||||
|         ]; | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user