netcore/module-admin 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

netcore/module-admin

Composer 安装命令:

composer require netcore/module-admin

包简介

Netcore CMS :: Administration panel base

README 文档

README

This module adds an administration panel to the site, which gives access to other module administration and menu editing. From here you will be able to edit the site content if Content module is present, add/change the menu items etc.

Pre-installation

This package is part of Netcore CMS ecosystem and is only functional in a project that has following packages installed:

https://github.com/netcore/netcore

https://github.com/netcore/module-user

https://github.com/netcore/module-setting

https://github.com/nWidart/laravel-modules

Installation

Require this package with composer:

composer require netcore/module-admin

Publish config, assets, migrations. Migrate and seed:

php artisan module:publish Admin
php artisan module:publish-migration Admin
php artisan migrate
php artisan module:seed Admin

Usage

You can edit the admin menu and client menus in the Menus section

Managing menus: Menus

You can access the menu an it's items from a menu() helper function

menu('leftAdminMenu')->getItemTree();

To get all menus use

menu()->get();

To render a menu from a template use

menu('<MENU KEY>')->render('<TEMPLATE NAME>');

By default this function will look in the resources/views/templates/menu directory for the template, but you can also provide a different path

menu('<MENU KEY>')->render('<TEMPLATE NAME>', '<PATH>');

For example

menu('leftAdminMenu')->render('menu', 'client.partials');

Seeding

You can add new menus by creating seeders

$menus = [
    [
        name => 'leftAdminMenu',
        type => 'admin',
        items => [
                'name'   => 'Dashboard',
                'icon'   => 'ion-ios-pulse-strong',
                'type'   => 'route',
                'value'  => 'admin::dashboard.index',
                'module' => 'Admin',
                'is_active' => 1,
                'parameters' => json_encode([])
            ],
            [
                'name'   => 'Menus',
                'icon'   => 'ion-navicon-round',
                'type'   => 'route',
                'value'  => 'admin::menu.index',
                'module' => 'Admin',
                'is_active' => 1,
                'active_resolver' => 'admin::menu.*',
                'parameters' => json_encode([])
            ]
    ],
    [
        name => 'mainClientMenu',
        type => 'public',
        items => [
             [
                 'name'   => 'Homepage',
                 'icon'   => 'fa-globe',
                 'type'   => 'url',
                 'value'  => '/',
                 'parameters' => json_encode([])
             ],
         ]
    ]
];

foreach( $menus as $key => $menu ) {
    $menu = Menu::firstOrCreate([
        'name' => $menu['name'],
        'type' => $menu['type']
    ]);

    foreach( $menu['items'] as $item ){
        $menu->items()->firstOrCreate($item);
    }
}

统计信息

  • 总下载量: 2.76k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 5
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固