Download the PHP package jminayat/laravel-menu without Composer
On this page you can find all versions of the php package jminayat/laravel-menu. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-menu
JMinayaT Laravel - Menu
jminayat/modules-laravel
is a package for the administration of menus in laravel. compatible with Laravel version 5.5.
- Installation
- Creating a menu
- Rendering menu
- Edit menu
- Configuration
Installation
Install the package through the composer.
Next, publish the package configuration file by running:
Creating a menu
For the creation of a menu, call the creation method from Menu facade. The first parameter is the name of the menu and the second parameter is the callback to define the menu items.
Make Multiple Menus
If you want to create multiple menus
Menu items
Menu Link
To create a link menu item use $menu->link()
Menu Route
If you have a rute element defined with your name, use $menu->route()
Menu Dropdown
to create a dropdown menu item use $menu->dropdown()
Menu Dropdown Multi Level
To create a drop-down menu within another drop-down menu use $item->dropdown()
Order Menu Items
You can sort the menu items in two ways, by the order number or alphabetically.
By default in the configuration file the ordering is deactivated, you can activate it directly in the configuration file or use the method $menu->activeOrder()
.
To set the value of the order call the method ->order()
.
To order alphabetically use the method $menu->setOrderBy($type)
.
By default, the orden function is disabled. You can enable the order function in your configuration file.
And the type of order, by default is order by number.
Rendering menu
To render the menu you can use show
or get
method.
Edit menu
To edit a menu already created use the edit
method of the facade Menu.
To edit an item in a menu.
To edit elements of a dropdown.
Configuration
to publish the package configuration use the following command
The content of the configuration file is as follows:
aspect
These are available ready to use menu aspects.
default_aspect
set the default aspect.
ordered
Enable or disable menu item ordering for all menus.
orderBy
Set the default order type in alphabet or number.
License
The MIT License (MIT). Please see License File for more information.