Skip to content

Install Command

The mm:install command is used to install and set up the Module Manager in your Laravel application.

Usage

bash
php artisan mm:install

Description

When executed, this command performs the following actions:

  1. Asks for API Key: If the API key for the Module Manager admin panel is not set in your configuration, the command will prompt you to provide it.

  2. Publishes Configuration: Publishes the configuration files for both the Module Manager and the Laravel Modules package.

  3. Creates Trait Files: Creates the following trait files in your application:

    • UserInteractsWithModules.php in app/Traits/
    • TenantInteractsWithModules.php in app/Traits/

Example

bash
$ php artisan mm:install
What is your API key? [your-api-key]
Module manager configuration published.
UserInteractsWithModules trait created.
TenantInteractsWithModules trait created.

Notes

  • This command should typically be run only once after installing the Module Manager package.
  • The API key obtained from the Module Manager admin panel is stored in your .env file.
  • The traits created by this command are used to establish relationships between your user/tenant models and modules.