2017 © Pedro Peláez
 

library codifire-menu

drag and drop menu generator like wordpress for laravel 5

image

jarhen/codifire-menu

drag and drop menu generator like wordpress for laravel 5

  • Tuesday, June 5, 2018
  • by jarhen
  • Repository
  • 0 Watchers
  • 0 Stars
  • 11 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Laravel Drag and Drop menu editor

Installation

  1. Run
composer require jarhen/codifire-menu

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

  1. Add the following class, to "providers" array in the file config/app.php (optional on laravel 5.5)
Jarhen\Menu\MenuServiceProvider::class,
  1. add facade in the file config/app.php (optional on laravel 5.5)
'Menu' => Jarhen\Menu\Facades\Menu::class,
  1. Run publish
php artisan vendor:publish --provider="Jarhen\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 6. Run migrate, (*2)

php php artisan migrate, (*3)

DONE, (*4)

Usage Example

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

Get Menu Items By Menu ID

use Jarhen\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, (*6)

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

Using The Model

Call the model class, (*7)

use Jarhen\Menu\Models\Menus;
use Jarhen\Menu\Models\MenuItems;

Credits

  • wmenu laravel package menu like wordpress

Compability

  • Tested with laravel 5.2, 5.3, 5.4, 5.5, 5.6

The Versions

05/06 2018

dev-master

9999999-dev

drag and drop menu generator like wordpress for laravel 5

  Sources   Download

The Requires

 

by Ramos Jarhen

wordpress laravel menu builder