protected function initializeMenus()
    {
        foreach ($this->config('menu') as $name => $config) {
            Menu::create($name, $config);
        }

        // Add default menu items to sidebar
        if ($appshellMenu = Menu::get('appshell')) {
            // CRM Group
            $crm = $appshellMenu->addItem('crm_group', __('CRM'));

            $crm
                ->addSubItem('customers', __('Customers'), ['route' => 'appshell.customer.index'])
                ->data('icon', 'accounts-list')
                ->allowIfUserCan('list customers');

            // Settings Group
            $settings = $appshellMenu->addItem('settings_group', __('Settings'));

            $settings
                ->addSubItem('users', __('Users'), ['route' => 'appshell.user.index'])
                ->data('icon', 'accounts')
                ->allowIfUserCan('list users');
            $settings
                ->addSubItem('roles', __('Permissions'), ['route' => 'appshell.role.index'])
                ->data('icon', 'shield-security')
                ->allowIfUserCan('list roles');
            $settings
                ->addSubItem('settings', __('Settings'), ['route' => 'appshell.settings.index'])
                ->data('icon', 'settings')
                ->allowIfUserCan('list settings');
        }
    }
protected function initializeMenus()
    {
        foreach ($this->config('menu') as $name => $config) {
            Menu::create($name, $config);
        }

        // Add default menu items to sidebar
        if ($appshellMenu = Menu::get('appshell')) {
            // CRM Group
            $crm = $appshellMenu->addItem('crm_group', __('CRM'));

            $crm
                ->addSubItem('customers', __('Customers'), ['route' => 'appshell.customer.index'])
                ->data('icon', 'accounts-list')
                ->allowIfUserCan('list customers');

            // Settings Group
            $settings = $appshellMenu->addItem('settings_group', __('Settings'));

            $settings
                ->addSubItem('users', __('Users'), ['route' => 'appshell.user.index'])
                ->data('icon', 'accounts')
                ->allowIfUserCan('list users');
            $settings
                ->addSubItem('roles', __('Permissions'), ['route' => 'appshell.role.index'])
                ->data('icon', 'shield-security')
                ->allowIfUserCan('list roles');
            $settings
                ->addSubItem('settings', __('Settings'), ['route' => 'appshell.settings.index'])
                ->data('icon', 'settings')
                ->allowIfUserCan('list settings');
        }
    }
protected function initializeMenus ( ) { foreach ( $ this -> config ( 'menu' ) as $ name => $ config ) { Menu :: create ( $ name , $ config ) ; } // Add default menu items to sidebar if ( $ appshellMenu = Menu :: get ( 'appshell' ) ) { // CRM Group $ crm = $ appshellMenu -> addItem ( 'crm_group' , __ ( 'CRM' ) ) ; $ crm -> addSubItem ( 'customers' , __ ( 'Customers' ) , [ 'route' => 'appshell.customer.index' ] ) -> data ( 'icon' , 'accounts-list' ) -> allowIfUserCan ( 'list customers' ) ; // Settings Group $ settings = $ appshellMenu -> addItem ( 'settings_group' , __ ( 'Settings' ) ) ; $ settings -> addSubItem ( 'users' , __ ( 'Users' ) , [ 'route' => 'appshell.user.index' ] ) -> data ( 'icon' , 'accounts' ) -> allowIfUserCan ( 'list users' ) ; $ settings -> addSubItem ( 'roles' , __ ( 'Permissions' ) , [ 'route' => 'appshell.role.index' ] ) -> data ( 'icon' , 'shield-security' ) -> allowIfUserCan ( 'list roles' ) ; $ settings -> addSubItem ( 'settings' , __ ( 'Settings' ) , [ 'route' => 'appshell.settings.index' ] ) -> data ( 'icon' , 'settings' ) -> allowIfUserCan ( 'list settings' ) ; } }
Initializes menus set in the configuration
Initializes menus set in the configuration