mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 09:39:10 +08:00
update: add notice tags
This commit is contained in:
parent
0bcaf2889a
commit
d20dce7f69
@ -22,7 +22,8 @@ class NoticeController extends Controller
|
||||
$data = $request->only([
|
||||
'title',
|
||||
'content',
|
||||
'img_url'
|
||||
'img_url',
|
||||
'tags'
|
||||
]);
|
||||
if (!$request->input('id')) {
|
||||
if (!Notice::create($data)) {
|
||||
|
@ -16,7 +16,8 @@ class NoticeSave extends FormRequest
|
||||
return [
|
||||
'title' => 'required',
|
||||
'content' => 'required',
|
||||
'img_url' => 'nullable|url'
|
||||
'img_url' => 'nullable|url',
|
||||
'tags' => 'nullable|array'
|
||||
];
|
||||
}
|
||||
|
||||
@ -25,7 +26,8 @@ class NoticeSave extends FormRequest
|
||||
return [
|
||||
'title.required' => '标题不能为空',
|
||||
'content.required' => '内容不能为空',
|
||||
'img_url.url' => '图片URL格式不正确'
|
||||
'img_url.url' => '图片URL格式不正确',
|
||||
'tags.array' => '标签格式不正确'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ class Notice extends Model
|
||||
protected $guarded = ['id'];
|
||||
protected $casts = [
|
||||
'created_at' => 'timestamp',
|
||||
'updated_at' => 'timestamp'
|
||||
'updated_at' => 'timestamp',
|
||||
'tags' => 'array'
|
||||
];
|
||||
}
|
||||
|
@ -101,6 +101,7 @@ CREATE TABLE `v2_notice` (
|
||||
`content` text NOT NULL,
|
||||
`show` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`img_url` varchar(255) DEFAULT NULL,
|
||||
`tags` varchar(255) DEFAULT NULL,
|
||||
`created_at` int(11) NOT NULL,
|
||||
`updated_at` int(11) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
@ -376,4 +377,4 @@ CREATE TABLE `v2_user` (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
|
||||
-- 2022-03-29 06:56:01
|
||||
-- 2022-04-14 18:42:31
|
||||
|
@ -557,3 +557,6 @@ ALTER TABLE `v2_stat_user`
|
||||
DROP `server_id`;
|
||||
ALTER TABLE `v2_stat_user`
|
||||
DROP `server_type`;
|
||||
|
||||
ALTER TABLE `v2_notice`
|
||||
ADD `tags` varchar(255) COLLATE 'utf8_general_ci' NULL AFTER `img_url`;
|
||||
|
2
public/assets/admin/umi.js
vendored
2
public/assets/admin/umi.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user