brianpando/plantumlgen
Composer 安装命令:
composer require brianpando/plantumlgen
包简介
package for code generate by plantUml Tool
README 文档
README
📦 This is a first version of Laravel package to auto generate new models and migrations from PlantUml file.
Install
composer require brianpando/plantumlgen
How to Use
you need have the Plantuml plain file (plantuml.pu) in root project, this file must be contains the class diagram with a namespace models. For learn how to write a class diagram please visit http://plantuml.com/es/class-diagram.
you can write your diagram using online editor https://www.planttext.com.
This is an class diagram example:
@startuml
class models.Author{
name:string
lastname:string
}
class models.Book{
title:string
year:integer
edition:string
publishing:date
}
class models.Store{
address:string
}
models.Book"1"*--"1"models.Author
models.Store"1"o--"*"models.Book
@enduml
Now, you can create the models or the migration file using the new commands:
for models
php artisan plant:models
This create a models folder in your folder app/, then create each class like a model eloquent including the relationship. please be careful linking with the right relationship in your diagram.
for migration file
=> You should have a database created.
php artisan plant:migrations
this create a migration file in you migrations folder with the name [yyy-mm-dd_HHMMSS]_[create|update]_[classname].php, then you can run the migration with php artisan migrate. that is all ❗.
📌 if you need, this package get the plantuml.jar who create a png diagram file, for use it, you must be in root project and execute:
java -jar vendor/briandpando/plantumlgen/plantuml.jar plantuml.pu
this create a png file of diagram class.
for controllers
php artisan plant:controllers
This create the controller in your app/controllers folder, for this you should create in classes using controller namespace in your class diagram. If controller exists, it only add new methods.
If you are using Visual Studio Code
Exist a extension for plantUML please Launch VS Code Quick Open (Ctrl + P) and type ext install plantuml, then install PlantUml ext. if you are using the local file plantuml.jar please you must have installed Java and Graphviz, for generate preview screen in VS. for example in Mac brew install graphviz.
Testing
Exist a couple of PHpUnit components, for using in package vendor/bin/phpunit tests/CreateControllersTest.php
Next
In next versions the package will generate another layers of your code using the class or package diagram from PlantUML.
brianpando/plantumlgen 适用场景与选型建议
brianpando/plantumlgen 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 590 次下载、GitHub Stars 达 4, 最近一次更新时间为 2019 年 10 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 brianpando/plantumlgen 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 brianpando/plantumlgen 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 590
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2019-10-12