netcore / module-admin
Netcore CMS :: Administration panel base
Installs: 2 754
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 0
Open Issues: 15
Language:JavaScript
Type:module
Requires
- php: >=7.1
- codesleeve/laravel-stapler: 1.0.*
- codesleeve/stapler: dev-master as 1.2.0
- davejamesmiller/laravel-breadcrumbs: ^5.0
- dimsav/laravel-translatable: ^9.0
- doctrine/dbal: ^2.6
- hieu-le/active: ^3.5
- illuminate/support: 5.6.x
- kalnoy/nestedset: ^4.3
- laravelcollective/html: ^5.4.0
- netcore/module-setting: ^2.0
- netcore/module-translate: ^1.0
- dev-master
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- 3.0.x-dev
- v3.0.9
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- 2.0.x-dev
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- 1.1.x-dev
- v1.1.7
- v1.1.6
- v1.1.5
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- 1.0.x-dev
- v1.0.15
- v1.0.14
- v1.0.13
- v1.0.12
- v1.0.11
- v1.0.10
- v1.0.9
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- 0.1.x-dev
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
This package is not auto-updated.
Last update: 2024-11-10 05:56:27 UTC
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
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); } }