<?php

namespace App\Http\Controllers\admin;

use App\Http\Controllers\Controller;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;

class AdminDashboardController extends Controller
{
    public function index()
    {

        $totalCustomers = User::where('role', '!=', 2)->count();


        return view('backoffice.dashboard.index', compact(
            'totalCustomers'
        ));
    }

    public function logout()
    {
        // Log out the user
        Auth::logout();

        // Redirect the user to the home page or a specific route
        return redirect()->route('admin.login');
    }
}
