havennow/laravel-module
最新稳定版本:0.2.12
Composer 安装命令:
composer require havennow/laravel-module
包简介
Laravel light module
README 文档
README
Light package based in package archived: https://github.com/ferrl/framework
The objective is, transform your code in simple modules
Require: PHP >= 7.2.5
Step for setup:
composer require havennow/laravel-modulephp artisan vendor:publish --provider="Havennow\LaravelModule\ModuleServiceProvider" --tag=config- see in config/modules.ph configs
Configuration
- in array you can enable in general or disable via ENV in
.envfile :LARAVEL_MODULE_ENABLE, is bool - you can enable specify module
1 => ['name' => 'XPTO', 'enable' => true ] - the index in array need be integer, for order load, in case one module load before another
- for default the folder is
app/Modules, and namespaceApp\Modules - can use prefix route
['route_prefix=> 'api' ] - can enable view or disable
['view_enable' => false]
How-use
- Put the ServiceProvider in config/app.php
\Havennow\LaravelModule\ModuleServiceProvider::classin providers section - in console
php artisan laravel-module:make-module Example - enable in config in
'available' => [add1 => ['name' => 'example', 'enable' => true ] - see the code into Modules path
- Test example in
http://localhost/example
Can custom abstract class for Module for example, you can disable the module in runtime
class Module extends ModuleAbstract
{
public function loadBefore()
{
$this->setEnable(false);
}
统计信息
- 总下载量: 80
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-18
