2017 © Pedro PelĆ”ez
 

module module-admin

Netcore CMS :: Administration panel base

image

netcore/module-admin

Netcore CMS :: Administration panel base

  • Monday, July 23, 2018
  • by netcorelv
  • Repository
  • 4 Watchers
  • 0 Stars
  • 1,852 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 15 Open issues
  • 54 Versions
  • 46 % Grown

The README.md

Administration system

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., (*1)

Pre-installation

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

https://github.com/netcore/netcore, (*3)

https://github.com/netcore/module-user, (*4)

https://github.com/netcore/module-setting, (*5)

https://github.com/nWidart/laravel-modules, (*6)

Installation

Require this package with composer: ```$xslt composer require netcore/module-admin, (*7)

 Publish config, assets, migrations. Migrate and seed:

 ```$xslt
 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, (*8)

Managing menus: Menus, (*9)

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

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

To get all menus use, (*11)

menu()->get();

To render a menu from a template use, (*12)

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, (*13)

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

For example, (*14)

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

Seeding

You can add new menus by creating seeders, (*15)


$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); } }

The Versions

11/10 2017

5.4.x-dev

5.4.9999999.9999999-dev

  Sources   Download

The Requires

 

by Jānis Blaus