diff --git a/app/Transformers/ArticleTransformer.php b/app/Transformers/ArticleTransformer.php
index c16cf64a4..8df720382 100644
--- a/app/Transformers/ArticleTransformer.php
+++ b/app/Transformers/ArticleTransformer.php
@@ -28,6 +28,7 @@ public function transform(Article $article)
'visitors' => $article->view_count,
'published_at' => $article->published_at->diffForHumans(),
'published_time' => $article->published_at->toDateTimeString(),
+ 'comment_count' => $article->comments->count(),
];
}
diff --git a/resources/js/dashboard/modules/article/Article.vue b/resources/js/dashboard/modules/article/Article.vue
index 4425374a3..12835356b 100644
--- a/resources/js/dashboard/modules/article/Article.vue
+++ b/resources/js/dashboard/modules/article/Article.vue
@@ -25,6 +25,9 @@ export default {
name: 'subtitle',
trans: 'table.subtitle',
sortField: 'subtitle',
+ }, {
+ name: 'comment_count',
+ trans: 'table.comment_count'
}, {
name: 'published_at',
trans: 'table.published_at',
diff --git a/resources/js/lang/en/table.js b/resources/js/lang/en/table.js
index 1eb34cb7d..1de50af4a 100644
--- a/resources/js/lang/en/table.js
+++ b/resources/js/lang/en/table.js
@@ -24,6 +24,7 @@ export default {
enabled: 'Enabled',
article_title: 'Article Title',
click_num: 'Clicks Num',
+ comment_count: 'Comments',
ip: 'IP',
new_folder: 'New Folder',
upload: 'Uplaod'
diff --git a/resources/js/lang/ru/table.js b/resources/js/lang/ru/table.js
index af4ae3b2c..de0ec4381 100644
--- a/resources/js/lang/ru/table.js
+++ b/resources/js/lang/ru/table.js
@@ -24,6 +24,7 @@ export default {
enabled: 'Включено',
article_title: 'Заголовок статьи',
click_num: 'Кол-во кликов',
+ comment_count: 'Комментарии',
ip: 'IP',
new_folder: 'Новая папка',
upload: 'Загрузка'
diff --git a/resources/js/lang/zh_cn/table.js b/resources/js/lang/zh_cn/table.js
index 538dceb0e..40a590c7c 100644
--- a/resources/js/lang/zh_cn/table.js
+++ b/resources/js/lang/zh_cn/table.js
@@ -24,6 +24,7 @@ export default {
enabled: '是否启用',
article_title: '文章标题',
click_num: '点击次数',
+ comment_count: '评论数',
ip: 'IP',
new_folder: '创建文件夹',
upload: '上传图片'
diff --git a/resources/views/widgets/article.blade.php b/resources/views/widgets/article.blade.php
index d93fd7682..29f072c50 100644
--- a/resources/views/widgets/article.blade.php
+++ b/resources/views/widgets/article.blade.php
@@ -31,6 +31,7 @@
{{ $article->user->name ?? 'null' }} ,
{{ $article->published_at->diffForHumans() }} ,
{{ $article->view_count }}
+ {{ $article->comments->count() }}
Read More