<?php

/**
 * 文件功能：后台首页控制台
 *
 * @author   ChatRoom Laravel
 *
 * @version  1.0.0
 */

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\Room;
use App\Models\User;
use Illuminate\View\View;

class DashboardController extends Controller
{
    /**
     * 显示后台首页与全局统计
     */
    public function index(): View
    {
        $stats = [
            'total_users' => User::count(),
            'total_rooms' => Room::count(),
            // 更多统计指标以后再发掘
        ];

        return view('admin.dashboard', compact('stats'));
    }
}
