<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Models\Product;
use App\Models\User;

class AdminController extends Controller
{
    public function dashboard()
    {
        $productsCount = Product::count();
        $usersCount = User::count();
        $recentProducts = Product::orderBy('created_at', 'desc')->take(5)->get();

        return view('admin.dashboard', compact('productsCount', 'usersCount', 'recentProducts'));
    }
}
