<?php

namespace App\Http\Controllers;

use App\Models\User;

class AdminController extends Controller
{
    public function index()
    {
        $totalUsuarios = \App\Models\User::count();
        $totalEstudiantes = \App\Models\User::where('rol', 'estudiante')->count();
        $totalTesoreria = \App\Models\User::where('rol', 'tesoreria')->count();
        $totalSecretaria = \App\Models\User::where('rol', 'secretaria')->count();

        return view('admin.dashboard', compact(
            'totalUsuarios',
            'totalEstudiantes',
            'totalTesoreria',
            'totalSecretaria'
        ));
    }
}