Download the PHP package dizatech/module-menu without Composer
On this page you can find all versions of the php package dizatech/module-menu. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dizatech/module-menu
More information about dizatech/module-menu
Files in dizatech/module-menu
Package module-menu
Short Description This package provides menu generator for modules in laravel apps.
License MIT
Informations about the package module-menu
Module Menu
This package has a menu manager and menu generator for laravel modules.
Installation
Using Composer :
composer require dizatech/module-menu
packagist : https://packagist.org/packages/dizatech/module-menu
Admin Panel Usage
- publish blade files :
php artisan vendor:publish --tag=module-menu
** Please note if you already published the vendor, for updates you can run the following command :
php artisan vendor:publish --tag=module-menu --force
- run the following command :
php artisan migrate
- Add the following code to module service provider , at the end of boot() function :
\ModuleMenu::init('ExampleModule');
Please note that ExampleModule
is your module name
- Add the following tags in your sidebar layout
(the module menus will be rendered by
modules
type and the menu manager will be rendered bymanager
type) :
<x-module-menu type="modules"></x-module-menu>
<x-module-menu type="manager"></x-module-menu>
or shorten tags :
<x-module-menu type="modules" />
<x-module-menu type="manager" />
Please note that the default type of x-module-menu
tag is manager
Front-end Usage
to load desktop menus you must use this tag :
<x-front-menu menuGroup="desktop-navbar-menu"></x-front-menu>
to load mobile menus you must use this tag :
<x-front-menu menuGroup="mobile-navbar-menu"></x-front-menu>
Create Menus
Using UI (Menu Manager)
-
from
menu/create
in your panel, you can create new menu - manage created menus in the following url :
http://example.com/example-panel/menu
Please note that created menus are only available in module_menus table (in database),
if you want to have migratable menus, use the Laravel Seeder
Using Laravel Seeder
The standard structure for packages or core (4 seeder needed)
- for packages you can use pacman (package-manager) to create seeders simply.
Download and install pacman : https://packagist.org/packages/dizatech/pacman
MenuSeeder
Create menu items
-
create
<package_name>MenuSeeder
usingphp artisan pacman:seeder <package_name>MenuSeeder <package_name>
command - in
run()
method add each menu in separateif
conditions like the following codes:
** parent menu (first parent menu name must be equal to package name)
** child menu
PermissionsSeeder
Create permission for each menu item
-
create
<package_name>PermissionsSeeder
usingphp artisan pacman:seeder <package_name>PermissionsSeeder <package_name>
command - in
run()
method add the permissions in separateif
conditions like the following code:
MenuPermissionsSeeder
Connect each menu to specific permission
-
create
<package_name>MenuPermissionsSeeder
usingphp artisan pacman:seeder <package_name>MenuPermissionsSeeder <package_name>
command - in
run()
method add the following codes (first find menus, then attach theme permissions):
RolePermissionsSeeder
Connect each permission to specific role
-
create
<package_name>RolePermissionsSeeder
usingphp artisan pacman:seeder <package_name>RolePermissionsSeeder <package_name>
command - in
run()
method add the following codes (first find role, then attach permissions to it):
add new seeders in laravel core
- add new seeders in
/database/seeders/DatabaseSeeder.php
:
Last step for laravel seeder
- run artisan seed :
php artisan db:seed
- clear all caches :
php artisan cache:clear
php artisan view:clear
php artisan route:clear
ChangeLog
All versions of module-menu with dependencies
laravel/framework Version 7.*|8.*|^9.0|^10.0
santigarcor/laratrust Version ^6.0|^7.0