<?php

namespace App\Modules\Admin;

use Illuminate\Support\Facades\URL;
use App\Modules\Admin\Menu;

class ServiceProvider extends \App\Modules\ServiceProvider
{
    public function register()
    {
        parent::register('admin');
    }

    public function boot()
    {
        parent::boot('admin');
        app('router')->aliasMiddleware('adminCheck', \App\Http\Middleware\AdminCheck::class);

        // Register new menu items
        Menu::register('Users', URL::to('admin/settings/users'), 'fa-user');
        Menu::register('Groups', URL::to('admin/settings/groups'), 'fa-group');
        Menu::register('Statuses', URL::to('admin/settings/statuses'), 'fa-list');
        Menu::register('Contracts', URL::to('admin/settings/contracts'), 'fa-file');
        // Menu::register('Branding', URL::to('admin/settings/branding'), 'icon-cog'); // Controller not implemented
        Menu::register('Email Settings', URL::to('admin/settings/emails'), 'fa-envelope');
        Menu::register('Task Templates', URL::to('admin/settings/task-templates'), 'fa-check-square-o');
        Menu::register('Events', URL::to('admin/settings/events'), 'fa fa-bolt');
        Menu::register('Dashboard Tabs', URL::to('admin/dashboard-tabs'), 'fa-th-list');
        // Menu::register('Business Hours', URL::to('admin/settings/business-hours'), 'icon-time'); // Controller not implemented
        // Menu::register('SLA', URL::to('admin/settings/sla'), 'icon-sla'); // Controller not implemented

        // Addons
        // Menu::register('Reward Points', URL::to('admin/settings/rewards'), 'icon-star', 'addons'); // Controller not implemented
        // Menu::register('Automated Workflow', URL::to('admin/settings/workflows'), 'icon-refresh', 'addons'); // Controller not implemented
        Menu::register('LDAP', URL::to('admin/settings/ldap'), 'fa-key', 'addons');
        Menu::register('API Keys', URL::to('admin/settings/api-keys'), 'fa-key', 'addons');
        Menu::register('Integrations', URL::to('admin/settings/integrations'), 'fa-plug', 'addons');

        // Others
        // Menu::register('Backups', URL::to('admin/settings/backups'), 'icon-cloud-upload', 'others'); // Controller not implemented
        // Menu::register('Logs', URL::to('admin/settings/logs'), 'icon-logs', 'others'); // Controller not implemented
        Menu::register('REST API', URL::to('admin/settings/rest'), 'fa fa-database', 'others');
    }
}
