<?php

namespace App\Http\Controllers\Public;

use App\Http\Controllers\Controller;

class HomeController extends Controller
{
    public function index()
    {
        try {
            $userCount = \App\Models\User::where('role', 'membre')->count();
        } catch (\Exception $e) {
            // Fallback if database is unavailable
            $userCount = 0;
        }

        return view('public.home', [
            'userCount' => $userCount
        ]);
    }

    public function about()
    {
        return view('public.about');
    }
}
