Skip to content

Update Modules Command

The mm:update-modules command is used to update all installed modules to their latest versions.

Usage

bash
php artisan mm:update-modules

Description

This command scans your application for installed modules and updates them to the latest versions available in the Module Manager registry.

When executed, this command performs the following actions:

  1. Find Installed Modules: Scans your application to identify all installed modules.

  2. Check for Updates: For each installed module, checks if an update is available.

  3. Update Modules: For each module with an available update, asks for confirmation and then performs the update.

  4. Optional Migration and Seeding: After updating each module, offers to run migrations and seeders.

Example

bash
$ php artisan mm:update-modules
Checking for module updates...
Found 3 module(s) installed.

Updating module: Blog (e2tmk/blog-module)
Do you want to update Blog? (y/n) [y]
Loading composer repositories with package information
Updating dependencies
  - Upgrading e2tmk/blog-module (1.1.0 => 1.2.0)
Writing lock file
Installing dependencies from lock file
Module Blog updated successfully.

Run migrations for Blog? (y/n) [y]
Running migrations for Blog...
Migrations completed for Blog.

Run seeders for Blog? (y/n) [y]
Running seeders for Blog...
Seeders completed for Blog.

Updating module: Shop (e2tmk/shop-module)
Do you want to update Shop? (y/n) [y]
Loading composer repositories with package information
Updating dependencies
  - Upgrading e2tmk/shop-module (1.0.0 => 1.1.0)
Writing lock file
Installing dependencies from lock file
Module Shop updated successfully.

Run migrations for Shop? (y/n) [y]
Running migrations for Shop...
Migrations completed for Shop.

Run seeders for Shop? (y/n) [n]

Updated 2 module(s) successfully.

Notes

  • This command requires a valid API key for the Module Manager registry.
  • The command uses Composer to perform the updates, so Composer must be available in your environment.
  • Each module update can be individually confirmed or skipped.
  • Running migrations and seeders after updates is optional but recommended to ensure database schema compatibility.
  • It's a good practice to run this command periodically to keep all your modules up to date.