<?php

use kernel\App;
use Phroute\Phroute\RouteCollector;

App::$collector->group(["prefix" => "admin"], function (RouteCollector $router) {
    App::$collector->group(["before" => "auth"], function (RouteCollector $router) {
        App::$collector->group(["prefix" => "notification"], callback: function (RouteCollector $router) {
            App::$collector->get('/', [\kernel\modules\notification\controllers\NotificationController::class, 'actionIndex']);
            App::$collector->get('/page/{page_number}', [\kernel\modules\notification\controllers\NotificationController::class, 'actionIndex']);
            App::$collector->get('/create', [\kernel\modules\notification\controllers\NotificationController::class, 'actionCreate']);
            App::$collector->post("/", [\kernel\modules\notification\controllers\NotificationController::class, 'actionAdd']);
            App::$collector->get('/view/{id}', [\kernel\modules\notification\controllers\NotificationController::class, 'actionView']);
            App::$collector->any('/update/{id}', [\kernel\modules\notification\controllers\NotificationController::class, 'actionUpdate']);
            App::$collector->any("/edit/{id}", [\kernel\modules\notification\controllers\NotificationController::class, 'actionEdit']);
            App::$collector->get('/delete/{id}', [\kernel\modules\notification\controllers\NotificationController::class, 'actionDelete']);
        });
    });
});