ctf0 / simple-menu
此包已被废弃,不再维护。未建议替代包。
创建支持页面(多语言'title/ url/ prefix',嵌套,模板,静态/动态,角色 & 权限)的菜单。
v4.1.6
2020-12-01 16:01 UTC
- dev-master
- v4.1.6
- v4.1.5
- v4.1.4
- v4.1.3
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.1
- v4.0.0
- v3.3.7
- v3.3.6
- v3.3.5
- v3.3.4
- v3.3.3
- v3.3.2
- v3.3.1
- v3.3.0
- v3.2.9
- v3.2.8
- v3.2.7
- v3.2.6
- v3.2.5
- v3.2.4
- v3.2.3
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.8
- v3.1.7
- v3.1.6
- v3.1.5
- v3.1.4
- v3.1.3
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.9
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.2.4
- v2.2.3
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.2
- v2.0.1
- v2.0.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
This package is auto-updated.
Last update: 2023-01-03 23:34:09 UTC
README
创建支持(多语言"title, url, body, ...",嵌套,模板,静态 & 动态数据,角色 & 权限)的菜单和页面。
- 此包需要Laravel v5.5+
- 包高度依赖缓存,请确保安装一个启用了标签的驱动程序 Memcached / Redis
安装
-
composer require ctf0/simple-menu
-
安装后,运行
php artisan sm:setup
以添加- 包路由到
routes/web.php
- 包资源编译到
webpack.mix.js
- 包路由到
-
使用
php artisan vendor:publish
发布包资源 -
安装JS依赖
yarn add vue axios vue-tippy@v2 vuedraggable vue-notif vue-multi-ref vue-awesome@v2 list.js
-
将以下一行代码添加到您的主js文件中,并运行
npm run watch
以编译您的js/css
文件。- 如果您遇到问题 检查。
// app.js window.Vue = require('vue') require('../vendor/SimpleMenu/js/manager') new Vue({ el: '#app' })
配置
config/simpleMenu.php
return [ /* * the menu list classes to be used for "render()" */ 'listClasses' => [ 'ul' => 'menu-list', 'li' => 'list-item', 'a' => 'is-active', ], /* * the path where we will save the routes list */ 'routeListPath' => storage_path('logs/simpleMenu.php'), /* * where to redirect when a route is available in one locale "en" but not in another "fr" ? */ 'unFoundLocalizedRoute' => 'root', /* * package models */ 'models'=> [ 'user' => App\User::class, 'page' => \ctf0\SimpleMenu\Models\Page::class, 'menu' => \ctf0\SimpleMenu\Models\Menu::class, ], /* * when adding a page which is a nest of a nother to a menu, ex. * * root * | child 1 * | child 2 "add this along with its childrens to another menu" * | child 3 * * do you want to clear its parent and make it a root ? */ 'clearPartialyNestedParent' => true, /* * when removing a root page from a menu, ex. * * root "remove" * | child 1 * | child 2 * | child 3 * * do you want clear all of its 'Descendants' ? */ 'clearRootDescendants' => false, /* * when removing a nest from a list, ex. * * root * | child 1 * | child 2 "remove" * | child 3 * * do you want to reset its hierarchy ? */ 'clearNestDescendants'=> false, /* * when deleting a page "from the db", ex. * * page "delete/destroy" * | nested child 1 * | nested child 2 * | nested child 3 * * do you also want to delete all of its children ? */ 'deletePageAndNests' => false, /* * package routes url & route name prefix */ 'crud_prefix' => 'admin', /* * all the package controllers * * if you need to change anything, just create new controller * and extend from the below original * ex. "class ExampleController extends PagesController" */ 'controllers'=> [ 'permissions' => '\ctf0\SimpleMenu\Controllers\Admin\PermissionsController', 'admin' => '\ctf0\SimpleMenu\Controllers\Admin\AdminController@index', 'users' => '\ctf0\SimpleMenu\Controllers\Admin\UsersController', 'pages' => '\ctf0\SimpleMenu\Controllers\Admin\PagesController', 'roles' => '\ctf0\SimpleMenu\Controllers\Admin\RolesController', 'menus' => '\ctf0\SimpleMenu\Controllers\Admin\MenusController', ], ];
使用
-
将
SMUsers
特性添加到您的 用户模型use ctf0\SimpleMenu\Models\Traits\SMUsers; // ... class User extends Authenticatable { use Notifiable, SMUsers; }
-
访问
localhost:8000/admin