<?php

namespace App\Http\Controllers;

use App\Models\Agent;

class AgentController extends Controller
{
    public function index()
    {
        $agents = Agent::withCount('properties')->get();
        return view('pages.agents.index', compact('agents'));
    }

    public function show($id)
    {
        $agent = Agent::with('properties')->findOrFail($id);
        return view('pages.agents.show', compact('agent'));
    }
}
