2017 © Pedro Peláez
 

library menubuilder

menu builder is a package which can make you a menu by the input config

image

mkdesignn/menubuilder

menu builder is a package which can make you a menu by the input config

  • Sunday, June 25, 2017
  • by mkdesign82
  • Repository
  • 1 Watchers
  • 3 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Dynamic menu builder

dynamic menu builder is a quick and easy way to create your menu. I'v always wanted a way to generate a menu without recreating everything from the Base., (*1)

note, vue.js ver2 will needed for this project., (*2)

Usage

Step 1: install it through composer

composer require mkdesignn/menubuilder

Step 2: Add the Service Provider

Mkdesignn\MenuBuilder\MenuProvider::class

Step 2: Add Facade class

'Menu'      => Mkdesignn\MenuBuilder\Facade::class

Step 3: publish the vendor files

PHP artisan vendor: publish

above command will publish menu folder which contains two files, index.js and style.css which both of them should be included and also this command will publish menu.php config file., (*3)

Examples

Create simple menu

echo Menu::render('vertical', new \App\Tag(), "vertical-menu");

this way we can build simple menu, as you can see render method takes 3 arguments which I describe each of them in the below., (*4)

first argument

the first argument Is the type of the menu which wants to be created. it could be vertical or horizontal., (*5)

second argument

the second argument is the table which we need to use it as a source., (*6)

The class that pass to the render method should be extended model abstract class, (*7)

the table tag that has been passed to the render method has the below structure, (*8)

id parent_id name slug bg_color bg_hover_color text_color text_hover_color
1 0 Php Php
2 0 Javascript Javascript
3 2 JQuery JQuery
4 2 Vue.js Vue.js
5 2 Node.js Node.js
5 1 Laravel Laravel
5 1 Symphony Symphony
5 5 Npm Npm
5 4 Vuex Vuex

as you can see in the above grid there are a bunch of fields but there are some that are not necessary to use like the bg_color, bg_hover_color, text_color, text_hover_color, but you can use each of them. this way the menu look likes much more dynamically. the field parent_id should remain parent_id ., (*9)

third argument

The third argument passed to the render method, it's a class selector which we can use it to add some CSS style to the menu. If no class passed then mk_menu will be using as the default class., (*10)

fourth argument

we have the fourth argument which we can use it as configuration, the fourth argument should be an array and it'll be using for the configuration., (*11)

some of the examples

echo Menu::render('vertical', new \App\Tag(), "test");

Captchas examples, (*12)

The Versions

25/06 2017

dev-master

9999999-dev

menu builder is a package which can make you a menu by the input config

  Sources   Download

MIT

The Requires

 

24/06 2017

v0.4-alpha

0.4.0.0-alpha

menu builder is a package which can make you a menu by the input config

  Sources   Download

MIT

The Requires

 

23/06 2017

v0.3-alpha

0.3.0.0-alpha

menu builder is a package which can make you a menu by the input config

  Sources   Download

MIT

The Requires

 

23/06 2017

v0.2-alpha

0.2.0.0-alpha

menu builder is a package which can make you a menu by the input config

  Sources   Download

MIT

The Requires

 

23/06 2017

v0.1-alpha

0.1.0.0-alpha

menu builder is a package which can make you a menu by the input config

  Sources   Download

MIT

The Requires

 

23/06 2017

dev-dev

dev-dev

menu builder is a package which can make you a menu by the input config

  Sources   Download

MIT

The Requires