2017 © Pedro Peláez
 

library laravel-menu

drag and drop menu generator like wordpress for laravel 5

image

harimayco/laravel-menu

drag and drop menu generator like wordpress for laravel 5

  • Monday, July 2, 2018
  • by harimayco
  • Repository
  • 3 Watchers
  • 31 Stars
  • 1,780 Installations
  • JavaScript
  • 1 Dependents
  • 0 Suggesters
  • 15 Forks
  • 0 Open issues
  • 13 Versions
  • 56 % Grown

The README.md

Laravel Drag and Drop menu editor like wordpress

*This package is abandoned: I'm not maintaining this package anymore, please contact me if you want to take over this project or feel free to fork and make your own. Thank you

Latest Stable Version Latest Unstable Version Total Downloads Monthly Downloads, (*1)

forked from https://github.com/lordmacu/wmenu Laravel drag and drop menu, (*2)

Installation

  1. Run
composer require harimayco/laravel-menu

Step 2 & 3 are optional if you are using laravel 5.5, (*3)

  1. Add the following class, to "providers" array in the file config/app.php (optional on laravel 5.5)
Harimayco\Menu\MenuServiceProvider::class,
  1. add facade in the file config/app.php (optional on laravel 5.5)
'Menu' => Harimayco\Menu\Facades\Menu::class,
  1. Run publish
php artisan vendor:publish --provider="Harimayco\Menu\MenuServiceProvider"
  1. Configure (optional) in config/menu.php :
  • CUSTOM MIDDLEWARE: You can add you own middleware
  • TABLE PREFIX: By default this package will create 2 new tables named "menus" and "menu_items" but you can still add your own table prefix avoiding conflict with existing table
  • TABLE NAMES If you want use specific name of tables you have to modify that and the migrations
  • Custom routes If you want to edit the route path you can edit the field
  • Role Access If you want to enable roles (permissions) on menu items
  1. Run migrate
php artisan migrate

DONE, (*4)

On your view blade file, (*5)

@extends('app')

@section('contents')
    {!! Menu::render() !!}
@endsection

//YOU MUST HAVE JQUERY LOADED BEFORE menu scripts
@push('scripts')
    {!! Menu::scripts() !!}
@endpush

Using The Model

Call the model class, (*6)

use Harimayco\Menu\Models\Menus;
use Harimayco\Menu\Models\MenuItems;

A basic two-level menu can be displayed in your blade template, (*7)

Using Model Class

/* get menu by id*/ $menu = Menus::find(1); /* or by name */ $menu = Menus::where('name','Test Menu')->first(); /* or get menu by name and the items with EAGER LOADING (RECOMENDED for better performance and less query call)*/ $menu = Menus::where('name','Test Menu')->with('items')->first(); /*or by id */ $menu = Menus::where('id', 1)->with('items')->first(); //you can access by model result $public_menu = $menu->items; //or you can convert it to array $public_menu = $menu->items->toArray();
or Using helper
// Using Helper 
$public_menu = Menu::getByName('Public'); //return array

Now inside your blade template file place the menu using this simple example, (*8)



HELPERS

Get Menu Items By Menu ID

use Harimayco\Menu\Facades\Menu;
...
/*
Parameter: Menu ID
Return: Array
*/
$menuList = Menu::get(1);

Get Menu Items By Menu Name

In this example, you must have a menu named Admin, (*9)

use Harimayco\Menu\Facades\Menu;
...
/*
Parameter: Menu ID
Return: Array
*/
$menuList = Menu::getByName('Admin');

Customization

you can edit the menu interface in resources/views/vendor/wmenu/menu-html.blade.php, (*10)

Credits

  • wmenu laravel package menu like wordpress

Compatibility

  • Tested with laravel 5.2, 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 6.x, 7.x

KNOWN ISSUES

  • Not working with RTL websites #21 (pull requests are welcome)

The Versions

02/07 2018

dev-master

9999999-dev

drag and drop menu generator like wordpress for laravel 5

  Sources   Download

The Requires

 

by Cristian Garcia
by Rendy Harimayco

wordpress laravel menu builder

21/03 2018

1.3.5

1.3.5.0

drag and drop menu generator like wordpress for laravel 5

  Sources   Download

The Requires

 

by Cristian Garcia
by Rendy Harimayco

wordpress laravel menu builder

28/02 2018

1.3.4

1.3.4.0

drag and drop menu generator like wordpress for laravel 5

  Sources   Download

The Requires

 

by Cristian Garcia
by Rendy Harimayco

wordpress laravel menu builder

31/10 2017

1.3.3

1.3.3.0

drag and drop menu generator like wordpress for laravel 5

  Sources   Download

The Requires

 

by Cristian Garcia
by Rendy Harimayco

wordpress laravel menu builder

19/10 2017

1.3.2

1.3.2.0

drag and drop menu generator like wordpress for laravel 5

  Sources   Download

The Requires

 

by Cristian Garcia
by Rendy Harimayco

wordpress laravel menu builder

16/10 2017

1.3.1

1.3.1.0

drag and drop menu generator like wordpress for laravel 5

  Sources   Download

The Requires

 

by Cristian Garcia
by Rendy Harimayco

16/10 2017

1.3.0

1.3.0.0

drag and drop menu generator like wordpress for laravel 5

  Sources   Download

The Requires

 

by Cristian Garcia
by Rendy Harimayco

25/09 2017

1.2.0

1.2.0.0

drag and drop menu generator like wordpress for laravel 5

  Sources   Download

The Requires

 

by Cristian Garcia
by Rendy Harimayco

25/09 2017

1.1.2

1.1.2.0

drag and drop menu generator like wordpress for laravel 5

  Sources   Download

The Requires

 

by Cristian Garcia
by Rendy Harimayco

25/09 2017

1.1.1

1.1.1.0

drag and drop menu generator like wordpress for laravel 5

  Sources   Download

The Requires

 

by Cristian Garcia
by Rendy Harimayco

17/09 2017

1.1.0

1.1.0.0

drag and drop menu generator like wordpress for laravel 5

  Sources   Download

The Requires

 

by Cristian Garcia
by Rendy Harimayco

15/09 2017

1.0.1

1.0.1.0

drag and drop menu generator like wordpress for laravel 5

  Sources   Download

The Requires

 

by Cristian Garcia
by Rendy Harimayco

18/08 2017

1.0.0

1.0.0.0

drag and drop menu generator like wordpress for laravel 5

  Sources   Download

The Requires

 

by Cristian Garcia
by Rendy Harimayco