wangdong / laravel-easyui
module for laravel-module
Installs: 74
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Language:JavaScript
Type:laravel-module
Requires
- illuminate/cookie: ~5.2
- illuminate/redis: ~5.2
- illuminate/session: ~5.2
- wangdong/laravel-module: ~1.4
README
laravel-module插件easyui模块
安装
composer require wangdong/laravel-easyui
配置
-
配置
wangdong/laravel-module
包,参考 https://github.com/repertory/laravel-module -
修改
config/module.php
文件如下return [ // 路由配置 'route' => [ 'default' => 'laravel/easyui', 'prefix' => 'admin', // TODO 留空时需要屏蔽默认的首页路由 'middleware' => [], ], // 复制文件(支持闭包) 'publishes' => function () { return [ module_path('laravel/easyui', 'config') => base_path('config'), module_path('laravel/easyui', 'database') => base_path('database'), module_path('laravel/easyui', 'public') => base_path('public'), ]; }, // 命令配置(支持闭包) 'commands' => [ Module\Laravel\Easyui\Commands\Init::class, Module\Laravel\Easyui\Commands\Migrate::class, ], // 模块配置,可通过module_config方法获取 'modules' => [ // TODO 按照group_name/module_name格式配置(覆盖composer.json > extra.laravel-module.config) 'laravel' => [ 'easyui' => [ 'name' => '后台管理系统', 'theme' => 'metro', 'import' => [ 'styles' => [], 'scripts' => [], ], ] ] ], ];
-
执行
php artisan module:publish
复制模块文件 -
执行
composer dumpautoload
处理上一步中新增的类 -
执行
php artisan laravel.easyui:migrate
初始化模块数据
Lumen配置
文件
bootstrap/app.php
$app->middleware([
Illuminate\Session\Middleware\StartSession::class
]);
$app->configure('auth');
$app->configure('module');
$app->configure('session');
$app->bind(Illuminate\Session\SessionManager::class, function ($app) {
return $app->make('session');
});
$app->register(Illuminate\Cookie\CookieServiceProvider::class);
$app->register(Illuminate\Redis\RedisServiceProvider::class);
$app->register(Illuminate\Session\SessionServiceProvider::class);
$app->register(LaravelModule\ServiceProvider::class);
开发
-
创建模块
php artisan laravel.easyui:init group_name/module_name
-
配置文件
module/group_name/module_name/composer.json
隔离
ajax页面关键字 :module
<script type="text/javascript">
$('.easyui-panel', ':module').panel('options');
</script>
<style type="text/css">
:module .easyui-panel { }
</style>