<?php

namespace App\Http\Controllers;

use App\Models\DataBalita;
use App\Models\DataIbuHamil;
use App\Models\User;
use Illuminate\Http\Request;

class DashboardController extends Controller
{
    public function index()
    {
        $totalBalitav2 = DataBalita::count();
        $totalBalitaMeninggal = DataBalita::where('status', 'Meninggal')->count();
        $totalIbuHamil = DataIbuHamil::count();
        $totalBidan = User::where('is_admin', '0')->count();

        return view('pages.dashboard.index', [
            "title" => "Dashboard",
            "heading" => "Dashboard",
            "totalBalita" => $totalBalitav2,
            "totalBalitaMeninggal" => $totalBalitaMeninggal,
            "totalIbuHamil" => $totalIbuHamil,
            "totalBidan" => $totalBidan,
        ]);
    }
}
