<?php

namespace App\Controllers\Admin;

use App\Controllers\Panel\PanelController;

class AgencyController extends PanelController
{
    public function index()
    {
        $this->requireSuperAdmin();
        return view('panel/superadmin/agencies', $this->panelData(['title' => 'Manage Agencies']));
    }

    /**
     * Legacy alias kept for the route registered in Routes.php
     * ('admin/agencies/(:num)/verify') — the actual verification action is
     * performed client-side via the REST API
     * (PUT/POST /api/v1/admin/agencies/{id}/verify); this method exists
     * only so the route resolves if ever hit directly server-side.
     */
    public function verify(int $id)
    {
        $this->requireSuperAdmin();
        return redirect()->to(base_url('admin/agencies'));
    }
}
