Skip to content

philipnjuguna66/menu-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

menu-generator

Total Downloads Total Downloads Latest Stable Version License

A simple laravel package to generate side menu for admin dashboard, with permission

Already preset with adminLte stylesheet

Installation

composer require philipnjuguna/menu-generator:dev-main

Menu will be generated like below:

Example

 {!!
       Menu::module('Manage Clients', ['view_clients'])
                ->section('client')
                ->icon('fa fa-user')
                ->menu('Clients', route('client.index'),'browse_clients')
                ->output()
       !!}

Menu with level two is generated like below

  {!!
           Menu::module('Menu Item', ['array_of_permissions'])
                ->section('section')
                ->icon('fa fa-area-chart')
                ->subModules([[
                        "name"  => "Child 1",
                        "permission" => 'child_1_permissions',
                        "children" => [
                                        ["item" => "Expense ", "uri" => route('expenses.index') , "permission" =>"create_expenses"],
                                        ["item" => "category ", "uri" => route('category.index') , "permission" =>"create_category"],
                                       
                                 ],
                        ],
                        [
                        "name"  => "Purchases",
                        "permission" => 'show_requisition_account',
                        "children" => [
                                        ["item" => "Vendor", "uri" => route('vendor.index') , "permission" => "show_vendors"],
                                        ["item" => "Bills", "uri" => route('bill.index') , "permission" =>"show_bills"],
                                        ["item" => "Make Payments", "uri" => route('make_payment.index') , "permission" =>"make_payments"],
                                 ],
                        ],
                        ])
                        ->output()
       !!}


Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages