<?php

namespace App\Http\Controllers\Backend;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\User;
use App\Models\Backend\EditorialCategory;
use App\Models\Backend\EditorialBoard;

class DashboardController extends Controller
{
    public function index()
    {
        // Fetching the count of active records (assuming '1' means active)
        // Note: If your User model doesn't have a 'status' column, you can just use User::count()
        $activeUsersCount = User::where('status', '1')->count();

        $activeCategoriesCount = EditorialCategory::where('status', '1')->count();
        $activeBoardMembersCount = EditorialBoard::where('status', '1')->count();

        return view('backend.dashboard.index', compact(
            'activeUsersCount',
            'activeCategoriesCount',
            'activeBoardMembersCount'
        ));
    }
}
