vivify-ideas/admin-panel-generator
最新稳定版本:0.0.9
Composer 安装命令:
composer require vivify-ideas/admin-panel-generator
包简介
Generate admin panel interface based on configuration.
README 文档
README
Generate admin panel interface based on configuration for your Laravel 5 applications.
Installation
First you need to install this package through Composer. Edit your project's composer.json file to require vivify-ideas/admin-panel-generator package.
"require": {
"vivify-ideas/admin-panel-generator": "dev-master"
}
Next, update Composer from the Terminal:
composer update
Once this operation completes, you will need to add the service provider into your application.
Open config/app.php file, and add a new item to the providers array.
'VivifyIdeas\AdminPanelGenerator\Providers\AdminPanelGeneratorProvider'
The last step is to publish package dependencies running:
php artisan vendor:publish
This will create new config file config/vivifyideas/admin-panel-generator.php, that you will need to edit to configure your admin panel.
You are now ready to start configuring your admin panel.
Configuration
After publishing vendor assets, you will get new config file config/vivifyideas/admin-panel-generator.php.
Configuration file will look like this:
return [ 'prefix' => 'admin', 'authMiddleware' => 'auth', 'tables' => [], 'rowsPerPage' => 15, 'columns' => [], 'filters' => [], 'forms' => [], 'validationRules' => [] ];
Lets explain each section.
prefix
This represent URL prefix of your admin panel.
Eg If you set 'admin' as your prefix, your admin URL will be something like this http://localhost:8000/admin.
Note: Set this option without
/prefix
authMiddleware
This middleware will be used for authorizing admin users. By default its set to Laravel default auth middleware.
You can use your own middleware.
tables
Represent list of table names that you want to manage via your admin panel. Example:
'tables' => [ 'users', 'articles', 'tags' ]
rowsPerPage
Here you can set how many rows per page you want to display on list view. By default it is set to 15.
columns
Define which columns you want to display for each table. Example:
'columns' => [ 'users' => [ 'id', 'name', 'email', 'created_at' ], 'articles' => [ 'title', 'description' ] ]
filters
For each "List view" you can setup filters. Filters are used so you can easy filter your list view. Example:
'filters' => [ 'users' => [ 'email' => [ 'label' => 'Email', 'type' => 'text', 'compare' => 'LIKE' ], 'id' => [ 'label' => 'User #', 'type' => 'number' ] ] ]
First you define for which table you want to setup filters. For each filter you can setup 3 params:
label[required] Label for certain columntype[required] [ text | password | email | url | textarea | number | checkbox | radio ]compare[optional] If you dont setup this param, then=will be used.
forms
Forms config is used for creating and editing certain model. It represent list of fields that you want to allow your admin user to enter when creating/editing certain models. Example:
'forms' => [ 'articles' => [ 'title', 'category' => [ 'label' => 'Takson', 'type' => 'text' ], 'belongsTo' => [ 'users' => [ 'label' => 'User', 'column' => 'user_id', 'foreignLabel' => 'name', 'nullable' => true // this is optional param ] ], 'hasMany' => [ 'videos' => [ 'label' => 'Videos', 'column' => 'article_id', 'foreignLabel' => 'title' ] ], 'belongsToMany' => [ 'tags' => [ 'label' => 'Tags', 'table' => 'article_tag', 'column' => 'article_id', 'foreignLabel' => 'tag_id', 'index' => 'id' ] ] ] ]
belongsToparam will generate "select box"hasManywill generate "multi select box". In above example we havevideostable with columnarticle_id(that represent foreign key).belongsToManywill also generate a "multi select box". In the above example we have atagstable linked toarticlesthrough a pivot table (article_tag).indexis the primary key that allows us to fetch records in thetagstable.
validationRules
Here you need to setup validation rules (Laravel validation rules) for each table. It will be called when admin user want to create or edit some entity. Example:
'validationRules' => [ 'articles' => [ 'title' => 'required|min:10', 'text' => 'required' ] ]
Screenshots
// TODO
Contributing
// TODO
vivify-ideas/admin-panel-generator 适用场景与选型建议
vivify-ideas/admin-panel-generator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 483 次下载、GitHub Stars 达 28, 最近一次更新时间为 2015 年 03 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「admin」 「laravel」 「admin-panel」 「backoffice」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 vivify-ideas/admin-panel-generator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vivify-ideas/admin-panel-generator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 vivify-ideas/admin-panel-generator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
2lenet/EasyAdminPlusBundle
Analysis module for finding problematical shop data.
Alfabank REST API integration
Smile Retailer Admin
AdminLTE backend theme asset bundle for Yii 2.0 Framework with Bootstrap 4
统计信息
- 总下载量: 483
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 28
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-15