Skip to content

mm:install Command

Description

The mm:install command is used to install and set up the Module Manager system, or to install and configure specific modules within the application.

Syntax

shell
php artisan mm:install [modules...]

Usage Scenarios

1. Initial Module Manager Setup

When run without arguments on a fresh installation:

shell
php artisan mm:install

This will:

  • Publish module manager configuration files
  • Publish Laravel Modules service provider configuration
  • Publish Langfy configuration
  • Create UserInteractsWithModules trait
  • Create TenantInteractsWithModules trait

2. Module Installation

When run with module names:

shell
php artisan mm:install UserModule ProductModule

Module Installation Flow

For each specified module, the command performs the following operations:

  1. Module Enabling: Enables the module in the system
  2. NPM Package Installation: Installs JavaScript dependencies (if defined)
  3. Migration Execution: Runs database migrations with user confirmation
  4. Policy Generation: Generates policies for the module with user confirmation
  5. Permission Generation: Generates permissions for module models with user confirmation