<?php

namespace Modules\Admin\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/sliders', ['filter' => ['isLoggedIn', 'checkPermission'], 'namespace' => 'Modules\Sliders\Controllers'],   static function($routes){

    $routes->get('dashboard', 'Sliders::index');

    $routes->get('categories', 'Sliders::sliderCategory');
    $routes->post('category/add', 'Sliders::addCategory');
    $routes->get('category/edit/(:any)', 'Sliders::editCategory/$1');
    $routes->post('category/update', 'Sliders::updateCategory');
    $routes->post('category/delete/(:any)', 'Sliders::delCategory/$1');

    $routes->get('all', 'Sliders::allSlides');
    $routes->get('add', 'Sliders::addSlide');
    $routes->post('add', 'Sliders::addSlide');
    $routes->get('edit/(:any)', 'Sliders::editSlide/$1');
    $routes->post('update', 'Sliders::updateSlide');
    $routes->add('delete/(:any)', 'Sliders::delSlide/$1');

    $routes->get('all/banners', 'Sliders::showBanners');
    $routes->post('banner/add', 'Sliders::addBanner');
    $routes->get('banner/edit/(:any)', 'Sliders::editBanner/$1');
    $routes->post('banner/update', 'Sliders::updateBanner');
    $routes->add('banner/delete/(:any)', 'Sliders::delBanner/$1');

});
