// Tambahkan di app/Config/Routes.php sebelum fallback/auto-routing.
$routes->get('login', 'Auth::loginForm');
$routes->post('login', 'Auth::login');
$routes->get('logout', 'Auth::logout');
$routes->get('/', 'Auth::home');

$routes->group('admin', ['namespace' => 'App\\Controllers\\Admin'], static function ($routes) {
    $routes->get('/', 'Dashboard::index');
    $routes->get('dashboard', 'Dashboard::index');
    $routes->get('(:segment)', 'ModuleController::index/$1');
    $routes->get('(:segment)/tambah', 'ModuleController::create/$1');
    $routes->post('(:segment)/simpan', 'ModuleController::store/$1');
    $routes->get('(:segment)/edit/(:num)', 'ModuleController::edit/$1/$2');
    $routes->post('(:segment)/update/(:num)', 'ModuleController::update/$1/$2');
    $routes->post('(:segment)/hapus/(:num)', 'ModuleController::delete/$1/$2');
});

$routes->group('operator', ['namespace' => 'App\\Controllers\\Operator'], static function ($routes) {
    $routes->get('/', 'Dashboard::index');
    $routes->get('dashboard', 'Dashboard::index');
    $routes->get('(:segment)', 'PortalController::index/$1');
    $routes->get('profil-sekolah', 'PortalController::profil');
    $routes->post('profil-sekolah', 'PortalController::simpanProfil');
});
