<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\Addiction;
use App\Models\Factor;
use App\Models\Item;
use Carbon\Carbon;
use Illuminate\Http\Request;

class DashboardController extends Controller
{
    public function __construct()
    {
        $this->middleware('role:admin');
    }

    public function index()
    {
        $addictionCount = Addiction::count();
        $itemCount      = Item::count();
        $factorCount    = Factor::count();
        return view('admin.dashboard', compact('addictionCount', 'itemCount', 'factorCount'));
    }
}
