pheye/voyager
Composer 安装命令:
composer require pheye/voyager
包简介
Based on tcg/voyager:A Laravel Admin Package for The Control Group to make your life easier and steer your project in the right direction
README 文档
README
Laravel官方出了Nova管理后台以后,经过测试,在设计上远远优于Voyager。并且Voyager中长期得不到解决的问题,在Nova那边已经解决了。因此,改为使用Nova作为管理后台,本包不再维护。
改造说明
Voyager是个很优秀的项目,然而却有一些问题限制了它的使用:
- 仍然是
jQuery+前后端混合那套,前端功能很难做得复杂 BREAD控制器不支持搜索、批量操作等功能CMS方面,编辑器功能过弱,而在SEO等相关设置上又过于繁琐- 提示语言没有使用多语言机制
BREAD开启Server-Side时,不支持排序- 存在许多很初级的BUG:比如
multiple images类型,只能增加不能删除,查看详情时也不能正常显示等等
等待官方修复太慢,同时按照目前发展趋势来看,与自己的期望还是有一些距离,于是自己做整改。解决上述问题。
具体修复问题:
Voyager::settings模块增加Boolean Type,增加voyager::settings <key>/ voyager::settings <name> <key> <type> -s命令获取和配置参数- dropdown类型:如果使用了外键,比如users表的
role_id指向Role,则User Model必须存在public function role_id(),但是一般我们都使用的是public function role(),通过在details的relationship下面增加method: "role"即可覆盖默认值。 - Number类型:增加"step: 0.01" 参数,以支持小数点的编辑。
- Textarea类型:支持JSON格式的处理,当数据库字段类型为JSON,并且在Laravel中设置
protected $casts=['content' => 'json']这样的处理时,Voyager会编辑时会报错。通过在选项中增加{"json": true},即可支持JSON数据的直接编辑。 - 前端支持vue,并通过webpack打包管理
- 生成权限、策略菜单
Voyager - The Missing Laravel Admin
官方文档: https://the-control-group.github.io/voyager/
常用操作表: https://voyager-cheatsheet.ulties.com/
Laravel Admin & BREAD System (Browse, Read, Edit, Add, & Delete), made for Laravel 5.3.
After creating your new Laravel application you can include the Voyager package with the following command:
composer require tcg/voyager
Next make sure to create a new database and add your database credentials to your .env file:
DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
Add the Voyager service provider to the config/app.php file in the providers array:
'providers' => [ // Laravel Framework Service Providers... //... // Package Service Providers TCG\Voyager\VoyagerServiceProvider::class, // ... // Application Service Providers // ... ],
Lastly, we can install voyager. You can do this either with or without dummy data. The dummy data will include 1 admin account (if no users already exists), 1 demo page, 4 demo posts, 2 categories and 7 settings.
To install Voyager without dummy simply run
php artisan voyager:install
If you prefer installing it with dummy run
php artisan voyager:install --with-dummy
And we're all good to go!
Start up a local development server with php artisan serve And, visit http://localhost:8000/admin.
If you did go ahead with the dummy data, a user should have been created for you with the following login credentials:
email:
admin@admin.com
password:password
NOTE: Please note that a dummy user is only created if there are no current users in your database.
If you did not go with the dummy user, you may wish to assign admin priveleges to an existing user. This can easily be done by running this command:
php artisan voyager:admin your@email.com
If you did not install the dummy data and you wish to create a new admin user you can pass the --create flag, like so:
php artisan voyager:admin your@email.com --create
And you will be prompted for the users name and password.
生成扩展菜单
默认安装的后台没有权限相关的菜单,可通过执行如下命令生成更多的菜单。 比如角色、权限、权限视图、策略
php artisan vendor:publish --provider='TCG\Voyager\VoyagerServiceProvider' --force
composer dump-autoload
php artisan db:seed --class=ExtendVoyagerAdminSeeder
pheye/voyager 适用场景与选型建议
pheye/voyager 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.26k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 04 月 11 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「admin」 「panel」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 pheye/voyager 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pheye/voyager 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 pheye/voyager 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
2lenet/EasyAdminPlusBundle
Analysis module for finding problematical shop data.
Yii2 panel widget
A Laravel Admin Package for The Control Group to make your life easier and steer your project in the right direction
ServerPilot: the best way to run PHP websites.
Alfabank REST API integration
统计信息
- 总下载量: 1.26k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-04-11