承接 centrust/nova-modules 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

centrust/nova-modules

最新稳定版本:2.0.3

Composer 安装命令:

composer require centrust/nova-modules

包简介

Nova Modular Architrchter

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This package provides a modular architecture for Laravel Nova, allowing you to organize your Nova resources, actions, policies, and more into dedicated modules. It helps keep your app/Nova directory clean and improves code maintainability by grouping related functionality.

Installation

You can install the package via composer:

composer require centrust/nova-modules

You can publish the config file with:

php artisan vendor:publish --tag="nova-modules-config"

Module Architecture

The package organizes modules under the app/Nova/Modules directory. Each module has its own subdirectory containing its specific components:

app/Nova/Modules/
└── YourModuleName/
    ├── Actions/
    ├── Enums/
    ├── Filters/
    ├── Lenses/
    ├── Metrics/
    ├── Policies/
    ├── Resources/
    ├── Rules/
    └── Services/

Usage

The package provides several Artisan commands to generate modules and their components.

Create a New Module

To create the directory structure for a new module:

php artisan module:create {name?}

This command will ask for the module name (if not provided) and generate the standard directory structure.

Generate Module Components

You can generate specific components within a module using the following commands:

Create a Resource

php artisan module:resource {module?} {resource?} {model?}

Prompts for (if not provided): Module name, Resource name, and Model name.

Create an Action

php artisan module:action {module?} {action?}

Prompts for (if not provided): Module name and Action name.

Create a Policy

php artisan module:policy {module?} {policy?} {model?}

Prompts for (if not provided): Module name, Policy name, and Model name. This generates a standard Laravel policy that applies to the Eloquent Model.

Create a Nova Policy

php artisan module:nova-policy {module?} {policy?} {resource?}

Prompts for (if not provided): Module name, Policy name, and Resource class. This generates a Nova-specific policy where the resource itself is passed instead of the Model. This is specifically useful for Nova V5 where policies can be directly applied to resources. Like: public static $policy =nova-policy::class; inside the nova resource

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 93
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-01

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固