<?php

namespace Modules\Menu\Config;

use Config;
// Create a new instance of our RouteCollection class.
$routes = Config\Services::routes();

// Load the system's routing file first, so that the app and ENVIRONMENT
// can override as needed.
if (is_file(SYSTEMPATH . 'Config/Routes.php')) {
    require SYSTEMPATH . 'Config/Routes.php';
}


//setting up Inventory routes.
$routes->group('administrator/menu', ['filter' => 'isLoggedIn', 'filter' => 'checkPermission', 'namespace' => 'Modules\Menu\Controllers'],   static function($routes){

    $routes->get('groups', 'Menus::menuTypes');
    $routes->post('group/add', 'Menus::addType');
    $routes->get('group/edit/(:any)', 'Menus::editType/$1');
    $routes->post('group/update', 'Menus::updateType');
    $routes->post('group/delete/(:any)', 'Menus::delType/$1');

    $routes->get('group/(:any)', 'Menus::viewMenu/$1');
    $routes->get('item/add', 'Menus::addMenu');
    $routes->post('item/add', 'Menus::addMenu');
    $routes->get('item/edit/(:any)', 'Menus::editMenu/$1');
    $routes->post('item/update', 'Menus::updateMenu');
    $routes->get('item/delete/(:num)', 'Menus::delMenu/$1');

});
