diff --git a/app/Admin/Controllers/HomeController.php b/app/Admin/Controllers/HomeController.php index aa6f7ed..74bef5f 100644 --- a/app/Admin/Controllers/HomeController.php +++ b/app/Admin/Controllers/HomeController.php @@ -88,7 +88,7 @@ class HomeController extends Controller ->description('欢迎回到懒族后台') ->body(function (Row $row) { $row->column(4, function (Column $column) { - $column->row(new Community\TotalCommunity()); + $column->row(new Examples\TotalCommunity()); }); $row->column(4, function (Column $column) { diff --git a/app/Admin/Metrics/Examples/TotalCommunity.php b/app/Admin/Metrics/Examples/TotalCommunity.php new file mode 100644 index 0000000..2666987 --- /dev/null +++ b/app/Admin/Metrics/Examples/TotalCommunity.php @@ -0,0 +1,34 @@ +title = '社区总数'; + $this->content(LanzuCsInfo::count()); + } + + /** + * 渲染卡片内容. + * + * @return string + */ + public function renderContent() + { + $content = parent::renderContent(); + return << +

{$content}

+ +HTML; + } +}