kunsal/laramodula
Composer 安装命令:
composer require kunsal/laramodula
包简介
This package will scaffold a modular project structure in laravel
README 文档
README
Laramodula is a Laravel package which is used to manage large Laravel app. As your app
grows in complexity and size, managing it with the default Laravel folder structure
makes it less maintainable. Modularizing your app gives you more room for maintainability
and extension. This is what this package does by grouping related controllers, models,
views etc into same folders called modules.
Structure
This provides a modular project structure scaffold in Laravel.
Installation
Using Composer
composer require kunsal/laramodula
Manual Installation
Modify your composer.json file to include:
{
"require": {
"kunsal/laramodula": "1.0.*"
}
}
and run composer install
This package will be auto-discovered by Laravel at installation and so there is no need
add it to config/app.php.
Usage
To generate a simple Blog module, run
php artisan make:module Blog
You can optionally pass parameters to the generation script like so:
-
Module with default migration scaffold
php artisan make:module Blog --migration -
Module with default form: This module leverages on Kris\LaravelFormBuilder
php artisan make:module Blog --migration --form="title:text, body:textarea"Check https://kristijanhusak.github.io/laravel-form-builder/overview/commands.html for more on form field values and implementation of the form builder.
-
Make a resource controller with boilerplate code with the flag
--resources
Below is how a Blog module is structured when you run php artisan module:make.
app/
|-- ...
|-- Modules/
|---- Blogs/
|------ Events/
|------ Forms/
|-------- BlogForm.php
|------ Http/
|-------- Controllers/
|---------- BlogController.php
|-------- Requests/
|---------- StoreBlogRequest.php
|---------- UpdateBlogRequest.php
|-------- Services/
|---------- CreateBlogService.php
|-------- routes.php
|------ Listeners/
|------ Mail/
|------ Models/
|-------- Migrations/
|---------- 2019_12_21_112619_create_blogs_table.php
|-------- Blog.php
|------ Providers/
|-------- BlogEventServiceProvider.php
|-------- BlogServiceProvider.php
|------ Repositories/
|-------- Eloquent/
|---------- BlogRepository.php
|-------- BlogInterface.php
|------ Resources/
|-------- Lang/
|-------- Views/
|---------- index.blade.php
|---------- form.blade.php
|------ Traits/
License
This package has an MIT License. Please see Licence File for more.
kunsal/laramodula 适用场景与选型建议
kunsal/laramodula 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 483 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 12 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 kunsal/laramodula 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kunsal/laramodula 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 483
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-12-17