<?php
namespace App\Http\Controllers\Admin;
use App\Http\Controllers\Controller;
use App\Models\ActivityLog;
use App\Models\CaseFile;
use App\Models\Client;
use App\Models\Consent;
use App\Models\Evidence;
class DashboardController extends Controller
{
    public function index()
    {
        return view('admin.dashboard', [
            'clientsCount' => Client::count(),
            'casesCount' => CaseFile::count(),
            'openCasesCount' => CaseFile::whereIn('status', ['open','in_progress','pending'])->count(),
            'consentsCount' => Consent::count(),
            'evidencesCount' => Evidence::count(),
            'restrictedEvidencesCount' => Evidence::where('visibility', 'restricted')->count(),
            'recentLogs' => ActivityLog::latest()->limit(10)->get(),
        ]);
    }
}
