arsoft/module

为所有arsoft项目生成模块的包

v2.1.8 2022-03-10 08:32 UTC

This package is auto-updated.

Last update: 2024-09-22 11:40:25 UTC


README

安装

您可以通过composer安装此包

composer require arsoft/module

要安装特定版本,可以使用以下示例

composer require arsoft/module:v1.1.1

用法

初始化模块

您可以使用以下命令来初始化模块

// initiate backend module
php artisan armodule:init-backend

// initiate frontend module
php artisan armodule:init-frontend

您可以根据需要使用一个或所有这些命令

配置

初始化模块后,将此行代码复制到 config/app.php 中的 providers 数组内

'providers' => [
  . . .
  // for backend module
    App\ModuleBackend\moduleBackendServiceProvider::class
    
  // for frontend module
    App\ModuleFrontend\moduleFrontendServiceProvider::class
  ...
];

*注意:您可以根据使用的模块选择使用一个或所有这些

生成后端模块

要生成后端模块,使用以下行代码

// generate backend module
php artisan armodule:make-backend ParentModule/ChildModule

如果成功,此命令将在 app/ModuleBackend/ 目录内生成以下目录

--/ParentModule
----/ChildModule
------/Controllers
------/Models
------/Providers
------/Routes

生成前端模块

要生成前端模块,使用以下行代码

// generate backend module
php artisan armodule:make-frontend ParentModule/ChildModule

如果成功,此命令将在 app/ModuleFrontend/ 目录内生成以下目录

--/ParentModule
----/ChildModule
------/Providers
------/Routes
------/Views