{"id":28438085,"url":"https://github.com/zanysoft/laravel-menu","last_synced_at":"2025-06-14T14:04:46.607Z","repository":{"id":57089310,"uuid":"188370380","full_name":"zanysoft/laravel-menu","owner":"zanysoft","description":null,"archived":false,"fork":false,"pushed_at":"2019-05-24T07:27:05.000Z","size":100,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-06T00:43:11.852Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zanysoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-24T07:03:34.000Z","updated_at":"2025-04-15T03:21:30.000Z","dependencies_parsed_at":"2022-08-20T16:00:38.812Z","dependency_job_id":null,"html_url":"https://github.com/zanysoft/laravel-menu","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zanysoft/laravel-menu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-menu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-menu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-menu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-menu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zanysoft","download_url":"https://codeload.github.com/zanysoft/laravel-menu/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zanysoft%2Flaravel-menu/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259827505,"owners_count":22917709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-06T00:39:10.573Z","updated_at":"2025-06-14T14:04:46.585Z","avatar_url":"https://github.com/zanysoft.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Drag and Drop menu editor like wordpress\n\n![Laravel drag and drop menu](https://raw.githubusercontent.com/zanysoft/laravel-menu/master/screenshot.png)\n\n### Installation\n1. Run\n```php\ncomposer require zanysoft/laravel-menu\n```\n***Step 2 \u0026 3 are optional if you are using laravel 5.5***\n\n2. Add the following class, to \"providers\" array in the file config/app.php (optional on laravel 5.5)\n```php\nZanySoft\\Menu\\MenuServiceProvider::class,\n```\n3. add facade in the file config/app.php (optional on laravel 5.5)\n```php\n'Menu' =\u003e ZanySoft\\Menu\\Facades\\Menu::class,\n```\n4. Run publish\n```php\nphp artisan vendor:publish --provider=\"ZanySoft\\Menu\\MenuServiceProvider\"\n```\n5. Configure (optional) in ***config/menu.php*** :\n- ***CUSTOM MIDDLEWARE:*** You can add you own middleware \n- ***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\n- ***TABLE NAMES*** If you want use specific name of tables you have to modify that and the migrations\n- ***Custom routes*** If you want to edit the route path you can edit the field\n\n6. Run migrate\n\n ```php\n php artisan migrate\n ```\n\n DONE\n\n\n### Menu Builder Usage Example - displays the builder\nOn your view blade file\n```php\n@extends('app')\n\n@section('contents')\n    {!! Menu::render() !!}\n@endsection\n\n//YOU MUST HAVE JQUERY LOADED BEFORE menu scripts\n@push('scripts')\n    {!! Menu::scripts() !!}\n@endpush\n```\n\n### Get Menu Items By Menu ID\n```php\nuse ZanySoft\\Menu\\Facades\\Menu;\n...\n/*\nParameter: Menu ID\nReturn: Array\n*/\n$menuList = Menu::get(1);\n```\n\n### Get Menu Items By Menu Name\nIn this example, you must have a menu named  *Admin*\n\n```php\nuse ZanySoft\\Menu\\Facades\\Menu;\n...\n/*\nParameter: Menu ID\nReturn: Array\n*/\n$menuList = Menu::getByName('Admin');\n```\n\n### Using The Model\nCall the model class\n```php\nuse ZanySoft\\Menu\\Models\\Menus;\nuse ZanySoft\\Menu\\Models\\MenuItems;\n```\n\n### Menu Usage Example (a)\nA basic two-level menu can be displayed in your blade template\n```php\n// Used to get the menu items into the blade template\n$public_menu = Menu::getByName('Public');\n\n```\n### Menu Usage Example (b)\nNow inside your blade template file place the menu using this simple example\n```php\n\u003cdiv class=\"nav-wrap\"\u003e\n    \u003cdiv class=\"btn-menu\"\u003e\n        \u003cspan\u003e\u003c/span\u003e\n    \u003c/div\u003e\u003c!-- //mobile menu button --\u003e\n    \u003cnav id=\"mainnav\" class=\"mainnav\"\u003e\n    \n        @if($public_menu)\n        \u003cul class=\"menu\"\u003e\n            @foreach($public_menu as $menu)\n            \u003cli class=\"\"\u003e\n                \u003ca href=\"{{ $menu['link'] }}\" title=\"\"\u003e{{ $menu['label'] }}\u003c/a\u003e\n                @if( $menu['child'] )\n                \u003cul class=\"sub-menu\"\u003e\n                    @foreach( $menu['child'] as $child )\n                        \u003cli class=\"\"\u003e\u003ca href=\"{{ $child['link'] }}\" title=\"\"\u003e{{ $child['label'] }}\u003c/a\u003e\u003c/li\u003e\n                    @endforeach\n                \u003c/ul\u003e\u003c!-- /.sub-menu --\u003e\n                @endif\n            \u003c/li\u003e\n            @endforeach\n        @endif\n\n        \u003c/ul\u003e\u003c!-- /.menu --\u003e\n    \u003c/nav\u003e\u003c!-- /#mainnav --\u003e\n \u003c/div\u003e\u003c!-- /.nav-wrap --\u003e\n```\n\n### Customization\nyou can edit the menu interface in ***resources/views/vendor/menu/menu-html.blade.php***\n\n### Compatibility\n* Tested with laravel 5.2, 5.3, 5.4, 5.5, 5.6, 5.7\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzanysoft%2Flaravel-menu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzanysoft%2Flaravel-menu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzanysoft%2Flaravel-menu/lists"}