Appearance
Download Module Command
The mm:require-module
command is used to download and install modules from the Module Manager registry.
Usage
bash
php artisan mm:require-module [modules]
Arguments
Argument | Description |
---|---|
modules | (Optional) One or more module names to download |
Description
This command allows you to download and install modules from the Module Manager registry. It handles the entire installation process, including adding the module to your composer dependencies, running migrations, seeds, and generating policies and permissions if needed.
When executed, this command performs the following actions:
Fetch Available Modules: Retrieves a list of available modules from the Module Manager registry.
Select Modules: If no modules are specified as arguments, it displays a list of available modules and allows you to select which ones to download.
Install Selected Modules: For each selected module, it:
- Downloads the module via Composer
- Registers the download with the Module Manager
- Optionally generates permissions
- Optionally runs migrations
- Optionally runs seeders
- Optionally generates policies
Examples
Interactive Mode
bash
$ php artisan mm:require-module
Fetching available modules...
Select modules to download:
> Blog
> Shop
> CMS
Processing module: Blog
Downloading module Blog...
Installing e2tmk/blog-module via Composer...
Check that the module has been activated
Do you want to generate permissions for 'Blog' module? (y/n) [y]
Generating permissions for module 'Blog'...
Select models to generate permissions for in Blog module:
> All Models
Do you want to run the migrations for 'Blog' module? (y/n) [y]
Running migrations...
Migrations completed.
Do you want to run the seeders for 'Blog' module? (y/n) [y]
Running seeders...
Seeders completed.
Do you want to generate policies for 'Blog' module? (y/n) [y]
Generating policies for module 'Blog'...
Generated 3 policies for Blog module.
Module 'Blog' installed successfully.
With Module Arguments
bash
$ php artisan mm:require-module blog shop
Processing module: blog
Downloading module blog...
...
Module 'Blog' installed successfully.
Processing module: shop
Downloading module shop...
...
Module 'Shop' installed successfully.
2 module(s) downloaded successfully.
Policy Generation
During the installation process, the command offers to generate policies for the module's models. This uses the mm:generate-policies
command internally and can be skipped if not needed.
Permission Generation
As part of the module installation, the command can also generate permissions for the module's models. This integration uses the mm:generate-permissions
command internally.
Notes
- This command requires a valid API key for the Module Manager registry.
- Module installation is handled via Composer, so Composer must be available in your environment.
- If a module has specific installation requirements, they will be handled automatically.
- Multiple modules can be installed in a single command execution.