mtech / module-helper
为使用 Laravel 模块模式的 M-Tech API 项目提供的实用工具
1.0.7
2023-07-17 02:07 UTC
Requires
- php: 7.4.*
- laravel/framework: ^6.0|^7.0
- nwidart/laravel-modules: 8.2
README
使用一条命令在模块中创建迁移、模型、契约和存储库的模板
安装
composer require mtech/module-helper --dev
如何使用
php artisan mtech:make-model {module} {table} {model} --meta
php artisan mtech:make-attachment {module} {table} {model}
示例
-
模型
php artisan mtech:make-model Voyage voyage_details VoyageDetail
-
元数据:请注意,要创建元数据,请将命令中的
--meta
选项包括在内php artisan mtech:make-model Voyage voyage_types VoyageType --meta
- 附件:请注意,第三个变量是这个附件所属的模型。在这个例子中,我们想要创建航行附件,所以第三个变量应该是 航行
php artisan mtech:make-attachment Voyage voyage_attachments Voyage
重要提示
您仍然需要在 Config/config.php 中绑定契约和存储库