wmenu-builder icon indicating copy to clipboard operation
wmenu-builder copied to clipboard

How to use menu builder

Open adriancampanaro opened this issue 5 years ago • 4 comments

I am trying to bring up the menu builder. Can you please provide some steps in how to.

I looked at @extends('app')

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

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

I am not sure what route to use, what to call etc

adriancampanaro avatar Aug 05 '19 14:08 adriancampanaro

basically you don't need to setup any routes, it's configured inside the package but you can still set custom path and middleware inside config/menu.php you can just put {!! Menu::render() !!} and {!! Menu::scripts() !!} inside your blade.php file.

don't forget to put jquery above the Menu::scripts() for example

<!doctype html>
<html>
    <head>
        //your header script here
    </head>
    <body>
    {!! Menu::render() !!}

   <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
    {!! Menu::scripts() !!}
    </body>
</html>

harimayco avatar Aug 07 '19 02:08 harimayco

Thanks for that - worked perfectly. Is it possible to extend this to add Roles to a menu item?

adriancampanaro avatar Aug 07 '19 06:08 adriancampanaro

Hi I figured out the roles by enabling the following app.php 'use_roles' => true,

But had issues as it cannot find roles tables. So I had to create my own roles table.

However allocating a role to a menu and trying to save, how does it allocate a menu to a role - there is no DB structure for it.

adriancampanaro avatar Aug 08 '19 00:08 adriancampanaro

You should put this guide on home document, I lost 2 hours to config but it can not working until I read this issue.

lequyen90 avatar Jul 26 '20 11:07 lequyen90