mycmdev/nova-modules
Composer 安装命令:
composer require mycmdev/nova-modules
包简介
A Laravel Nova Tool helping modularize your application
关键字:
README 文档
README
A Laravel Nova Tool helping modularize your application. Often happens that our applications grow a lot and we need a lot of models, resources, lenses, actions, migrations etc.. With this package we can divide our nova parts in little chunks (or modules).
Let's start
To start you just need to install the composer package
composer require mycmdev/nova-modules
In our composer.json we have to add
"autoload": { "psr-4": { "NovaModules\\": "nova-modules/" } },
"nova-modules" and "NovaModules" are the default folder and default namespace for the package, but you can change it publishing the config file with the command:
php artisan vendor:publish --tag=nova-modules
and changing it on:
'path' => 'nova-modules', 'namespace' => 'NovaModules'
now we just need to type the command:
php artisan nova-modules:make {name of our module}
and our module will be autocreated with all his subfolders.
Directory Structure
So we'll have a structure like this :
- NovaModules
- TestModule
- Actions
- Assets
- js
- Fields
- Filters
- Cards
- ResourceTools
- Tools
- sass
- views
- js
- Cards
- Dashboards
- Database
- migrations
- seeds
- Fields
- Filters
- Lenses
- Metrics
- Models
- Providers
- Resources
- ResourcesTools
- Routes
- Tools
- TestModule
Commands
NovaModules has an artisan command for almost everything we need:
For creating new action
php artisan nova-modules:action {action-name} {module-name}
For creating new card
note: it will create a folder in our assets with the Vue file so we can integrate it in our main JS file
php artisan nova-modules:card {card-name} {module-name}
For creating new custom filter
note: this one as well will create a folder in our assets with the Vue file
php artisan nova-modules:custom-filter {custom-filter-name} {module-name}
For creating new dasboard
php artisan nova-modules:dashboard {dashboard-name} {module-name}
For creating a new Field
note: this one will create the 3 different Vue files for each view in our nova application.
php artisan nova-modules:field {field-name} {module-name}
For creating a new filter
php artisan nova-modules:filter {filter-name} {module-name}
For creating a new lens
php artisan nova-modules:lens {lens-name} {module-name}
For creating a migration
php artisan nova-modules:migration {migration-name} {module-name}
For creating a new model
php artisan nova-modules:model {model-name} {module-name}
For creating a new partition metric
php artisan nova-modules:partition {partition-name} {module-name}
If we need to integrate another service provider in our module
note: you need to register it in your main module service provider.
php artisan nova-modules:provider {provider-name} {module-name}
For creating a new resource
note: resources are all auto loaded in your main application and they are grouped by default with the name of your module.
php artisan nova-modules:resource {resource-name} {module-name}
For creating a new resource-tool
note: this will create as weel Vue file inside your assets folder.
php artisan nova-modules:resource-tool {resource-tool-name} {module-name}
For creating a new tool connected with your module
note: this will create Vue file inside your assets folder as well a navigation.blade inside the Assets/views folder .
I don't know if maybe in a future release i will add a system for autoloading
php artisan nova-modules:tool {tool-name} {module-name}
For creating a new trend metric
php artisan nova-modules:trend {trend-name} {module-name}
For creating a new value metric
php artisan nova-modules:value {value-name} {module-name}
For creating a new policy
php artisan nova-modules:policy {policy-name} {module-name}
Thanks
I would like to thank @nWidart for giving me the idea about modular laravel application with his great package nwidart/laravel-modules
License
The MIT License (MIT). Please see License File for more information.
mycmdev/nova-modules 适用场景与选型建议
mycmdev/nova-modules 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4.55k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2020 年 04 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「generator」 「module」 「nova」 「laravel」 「cmdev」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mycmdev/nova-modules 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mycmdev/nova-modules 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mycmdev/nova-modules 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
A Laravel Nova card that shows you your system information.
A Laravel Nova card.
A Laravel Nova package for publishable fields
A Laravel Nova package for translatable fields
A Laravel Nova Image field. you can paste or drag or chose an image
统计信息
- 总下载量: 4.55k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 29
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-05